Copy data files to IFS dir
Last Post 09 Jan 2009 06:34 PM by Lynne Noll. 10 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
Larry Swain
New Member
New Member
Posts:14

--
07 Jan 2009 04:14 PM
Need direction on how to copy physical files to an IFS dir. Each file needs to be an entry within the main directory. Thanks for assistance Larry Swain larry.swain@robins.af.mil
Harry Edmondson
Veteran Member
Veteran Member
Posts:782
Avatar

--
07 Jan 2009 04:46 PM Accepted Answer
Do you need then translated to ASCII? If not they are all already in the IFS under directory /QSYS.LIB, you can use COPY to get them from there to some other directory. If you need them translated to ASCII in comma or tab delimited format you could use CPYTOIMPF. If they are text-only files (no packed or binary fields) you could use FTP to copy and translate them. So many ways, depends what you need the result to look like.
Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16311
Avatar

--
07 Jan 2009 04:50 PM Accepted Answer
There are the CPY and CPYTOSTMF, CPYTOIMPF CL commands, and the cat, db2 and rfile QShell commands, all of which have various capabilities related to copying a PF to a STMF in the IFS. Which of these 6 suggestions is the best one for you? To answer that, I'd need to know a lot more about how you want the files formatted when you convert them into IFS files... It'd also be helpful to know how these IFS files will be used.
Larry Swain
New Member
New Member
Posts:14

--
07 Jan 2009 05:41 PM Accepted Answer
Data files will be moved to another application maintained by contractors. Need to keep data in EBCDIC. Data files are various lengths. Thanks lls
Harry Edmondson
Veteran Member
Veteran Member
Posts:782
Avatar

--
07 Jan 2009 06:43 PM Accepted Answer
This example copies file TABLEH, member TABLEH in library DATA to directory /Iseries and names it TABLEH. You can use either COPY or CPY.

COPY OBJ('/qsys.lib/data.lib/tableh.file/tableh.mbr'
     TOOBJ('/iseries/tableh')                       
     SYMLNK(*NO)                                    
     FROMCCSID(*OBJ)                                
     TOCCSID(*OBJ)                                  
     DTAFMT(*BINARY)                                
     SUBTREE(*NODIR)                                
     REPLACE(*NO)                                   
     OWNER(*NEW)                                    
Larry Swain
New Member
New Member
Posts:14

--
07 Jan 2009 07:47 PM Accepted Answer
What I would like to do is create a Dir in IFS - MKDIR TEST_PROJECT. Then have a C/L to copy data files to individual entries within TEST_PROJECT directory. WRKDIR would look like this: TEST_PROJECT FILE01 FILE02 FILE03 Thanks lls
Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16311
Avatar

--
07 Jan 2009 07:48 PM Accepted Answer
Lengths don't matter. You didn't say anything else about the format of the file (other than "various lengths"). Do you want the resulting stream files to have the exact same format as the database files? (If so, why bother moving them to stream files?!)
Larry Swain
New Member
New Member
Posts:14

--
07 Jan 2009 07:57 PM Accepted Answer
Data files need to maintain original size. Suggest how to do move. Thanks
Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16311
Avatar

--
07 Jan 2009 08:38 PM Accepted Answer
Use move or copy command. Already stated.
datapath
Basic Member
Basic Member
Posts:165
Avatar

--
08 Jan 2009 06:59 PM Accepted Answer
Maybe what he is trying to accomplish is to send these database files to a contractor, so he needs to create a save file, save databases to them, then copy the save file to the IFS using ftp, cpytostmf, or another method (like iSeries Access or copy from a shared folder using Windows).
Lynne Noll
Senior Member
Senior Member
Posts:6567

--
09 Jan 2009 06:34 PM Accepted Answer
Is the contractor working on an ISeries or on another platform? The easiest way to load a bunch of data onto another ISeries is with a save file. The save file can be copied to the IFS. If he is working on another platform, you generally need the packed data converted to zoned, which CPYTOIMPF can do. But this changes the length of the records.
You are not authorized to post a reply.

Acceptable Use Policy