Copy a Set of Files to an Existing Data Physical File

Copy a Set of Files to an Existing Data Physical File

This example copies (in text mode, and using the * wildcard) multiple files with one copy command to an already allocated Data Physical File on an IBM i system.

The file names used to create the member names in the destination Data Physical File are the source file names. However, note that file names on UNIX and Windows file systems often have a file extension as part of their name. A file extension is a suffix separated from the file's base name with a period (for example, BASE.TXT). Member names are limited to 10 characters on the IBM i system, so UDM must be instructed to remove the file extensions before copying them into the file.

The truncext attribute is used to instruct UDM to remove file name extensions from the source file prior to using the name as the destination member name.

This example assumes that the remote UNIX directory /opt/app/data contains the following list of files:

  • data001.txt
  • data002.txt
  • data003.txt
  • data004.pr
  • data005.pr

The result of the copy operation will create the following members in Data Physical File APPDATA:

  • DATA001
  • DATA002
  • DATA003

LIB File System

1 set _echo=yes _halton=warn
2 open unix=sol9 user=top098 pwd=p100m
3 cd unix=/opt/app/data
4 mode type=text
5 attrib local truncext=yes
6 copy unix=*.txt local=MYLIB/APPDATA
7 quit 

Components

Universal Data Mover Manager for IBM i