The Copy To Stream File 2 command is a front end to the system
CPYTOSTMF command. CPYTOSTMF2 uses a normal object prompt for a file
and member. The TOSTMF name defaults to allow a simple copy from a
data base member to an IFS stream file in the user's home directory.
Only a member of a program described physical file, a member of a
source physical file, or a save file may be copied.
Error messages are significantly better than those provided by
CPYTOSTMF when the object is not found or a non-supported file is
named.
A typical command would be:
CPYTOSTMF2 FILE(QCLSRC) FROMMBR(ABC)
The ABC member of the QCLSRC file would be copied to the user's home
directory and given the name 'ABC.mbr'. If the stream file does not
exist, it would be created.
A save file is also supported using a command such as:
CPYTOSTMF2 FILE(SAVF1) MBR(*NONE)
The stream file name would named 'SAVF1.savf'.
CPYTOSTMF2 escape messages you can monitor for
----------------------------------------------
TAA9894 The file type is not supported.
TAA9895 Object exists and STMFOPT(*NONE) was specified.
TAA9896 Not authorized for *W to object.
Escape messages from based on functions will be re-sent.
CPYTOSTMF2 Command parameters *CMD
-----------------------------
FILE The qualified name of the file to be copied. The
library value defaults to *LIBL. A specific library
or *CURLIB may also be used.
The file must be a program described physical file,
a source physical file, or a save file.
FROMMBR The member to be copied. *FIRST is the default. A
specific member or *LAST may be specified.
If a source member is copied, the date and sequence
number are dropped and only the SRCDTA field is
copied.
If a save file is to be copied, *NONE must be
specified.
TOSTMF The stream file name to copy to.
*DFT is the default which means: 1) if a data base
file member is copied, the stream file name will be
the member name plus '.mbr' or 2) if a save file is
copied, the stream file name name will be the file
name plus '.savf'. The stream file would be placed
in the user's home directory.
A full path name may be entered.
STMFOPT The stream file option. *NONE is the default. If
the stream file does not exist, it is created and
the records added. *ADD or *REPLACE may be used.
*ADD is not valid when copying a save file. The
value is passed thru to the CPYTOSTMF command.
CVTDTA The data conversion option defaults to *DFT.
If *DFT is used, and 1) if a data base file is
copied, the value assigned is *AUTO or 2) if a save
file is copied, the value assigned is *NONE.
*AUTO, *TBL, or *NONE may be specified. The value
is passed thru to the CPYTOSTMF command.
DBFCCSID *FILE is the default meaning to use the CCSID of the
data base file. The value is ignored if a save file
is copied.
A value between 1 and 65533 may be specified. The
value is passed thru to the CPYTOSTMF command.
STMFCCSID *STMF is the default meaning to use the CCSID of the
stream file. If the stream file does not exist, the
CCSID from the data base file is used.
The value is ignored if a save file is copied.
The special values *PCASCII or *STDASCII may be used
or a value between 1 and 65533. The value is passed
thru to the CPYTOSTMF command.
TBL The path name to be used to convert data from the
data base file member to the stream file. This
parameter is only valid if CVTDTA(*TBL) is
specified.
The value is ignored if a save file is copied.
The value is passed thru to the CPYTOSTMF command.
ENDLINFMT Specifies the end-of-line characters to insert into
the stream file. *CRLF is the default. *LF, *CR,
*LFCR, or *FIXED may be entered.
The value is ignored if a save file is copied.
The value is passed thru to the CPYTOSTMF command.
AUT The authority assigned to the stream file.
*DFT is the default meaning the owner will have *RWX
authority. *INDIR, *FILE, and *INDIRFILE may also
be specified.
The value is passed thru to the CPYTOSTMF command.
STMFCODPAG The code page to be used when determining the stream
file CCSID. *STMF is the default meaning no code
page processing is performed.
*PCASCII or *STDASCII may be entered or a value
between 1 and 32767.
The value is ignored if a save file is copied.
The value is passed thru to the CPYTOSTMF command
which has a special note in the help text regarding
the use of STMFCODPAG with STMFCCSID.
Restrictions
------------
Only a member of a program described physical file, a member of a
source physical file, or a save file may be copied.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKDBFMBR Check data base file member
CHKIFSE Check IFS entry
RSNLSTMSG Resend last message
RTVDBFA Retrieve data base file attributes
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDJLGMSG Send job log message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CPYTOSTMF2 *CMD TAAIFUG QATTCMD
TAAIFUGC *PGM CLP TAAIFUGC QATTCL
|