Hi
I hve created a txt file from a pf using cpytoimpf.The name of the txt file should have ccyymmddhhmmss in its name.I can retreive the date and time parameters from qdate and qtime.How do i name the txt file using a CL.
Software/Hardware used:
ASKED:
November 25, 2008 11:16 AM
UPDATED:
November 26, 2008 5:53 AM
do you mean to say that i can give the file name in stmf parameter (CPYTOIMPF) as xxxccyymmddhhmmss.I need to code this using cl and still not sure how to do it?Please suggest.
Yes
Something like this
DCL &TEXTFILENM *CHAR 40
dcl &curdt *char 6
dcl &curtm *char 6
/* build your CL file name as */
RTVSYSVAL SYSVAL(QDATE) RTNVAR(&CURDT)
RTVSYSVAL SYSVAL(QTime) RTNVAR(&CURTM)
ChgVar &TextFileNm (QDATE *TCAT QTIME *TCAT ‘.TXT’
CPYTOIMPF …
To stream file . . . . . . . . . TOSTMF &TextFileNm
Hi,
You’ll also need to specify the location in the IFS within the TOSTMF parameter and I’d suggest some sort of character reference before the date and time to indicate what sort of file it is. So your TOSTMF parameter should be something like :-
‘/EXPORT/My_Text_File_ccyymmddhhmmss.TXT’
Where EXPORT is an existing directory in the IFS and My_Text_File_ is a description of what the file is. You may have to experiment with some of the other parameters on the command for character conversion, delimiters, etc.
Regards,
Martin Gilbert.
Thanks a million for all your suggestion.