0 pts.
 Stream Files (STMF)
We have three Stream files that I need to copy into standard ISeries database files used in our ERP system. I found the 'CPYFRMSTMF' command, but this cmd seems to allow copies only to other Stream type files with directories.(QSYS.LIB) Does anyone know how to copy a stream file into an actual database file? Thanks!

Software/Hardware used:
ASKED: October 12, 2005  9:41 PM
UPDATED: November 15, 2009  4:10 AM

Answer Wiki:
You need to specify your target database file in IFS notation thus: /QSYS.LIB/TGTLIB.LIB/TGTFIL.FILE/TGTMBR.MBR Where TGTLIB, TGTFILE and TGTMBR are the names of the library, file and member that you want to copy the stream file data to. The target file must already exist. You will also get all kinds of other parameter options to control the code page conversion, end of line character and tab conversion. HTH Paul
Last Wiki Answer Submitted:  October 13, 2005  4:41 am  by  EnglishHaze   0 pts.
All Answer Wiki Contributors:  EnglishHaze   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

You can have a better result is uses CPYFRMIMPF : if is able to populate a DB2 file with columns, particularly, it is able to apply default values to null columns, a common state in text files that is rarely described in common 400 files.

 0 pts.

 

Note that although the CPFRMSTMF TOMBR() is a ‘database’ file, it must be “either a source physical file or a program-described physical file.” An externally-described database file is not allowed. As such, there isn’t much reason to do the copy. Any input from it by program can come from the streamfile almost as easy as from the program-described file. Further, issues such as line-wrap and CCSIDs might be under much better control by reading the streamfile.

Tom

 107,995 pts.