Posted: Thu Jul 22, 2004 10:00 pm Post subject: Adding date to file name that is being FTP'd.
Hey Guys,
We have a job that FTP's a certain file everyday. In order to differentiate the files being sent ,we have to append the date to the file name being FTP'd.
The parm used by FTP contains the following info :
server name
password
PUT 'aaaaaaaa.bbbbbbbb.ccc' filename.txt quit
This is what I did:
My first data set contains :
server name
password
I used a sort step something like this to append the date to the file name and write it to data set 2.
I had a IEBGENER step that would concatenate the above three data sets and copy it to the parm member that would be later used by the FTP step.
The output from IEBGENER step would look something like this :
server name
password
PUT 'aaaaaaaa.bbbbbbbb.ccc' filename20040722.txt
quit
Finally I had the FTP step which would use this parm member to FTP the file.
My question is can we achieve this in a single sort step without having to go thru all the tedious steps that I have mentined above I am rephrasing my question, can we have a sort statement that will read in
server name
password
PUT 'aaaaaaaa.bbbbbbbb.ccc' filename.txt
quit
and output this
server name
password
PUT 'aaaaaaaa.bbbbbbbb.ccc' filename20040722.txt
quit
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Fri Jul 23, 2004 5:29 am Post subject:
Ram,
The following JCL will give you the desired results. The parm / is used to write a new line. You can hardcode a value by enclosing by C'MY HARD CODED VALUE' which will be printed as
Code:
MY HARD CODED VALUE
since your servername and password are all constants you can hardcode them in the sort control cards itself. This will eliminate the IEBGENER step as well as 2 extra datasets
Joined: 19 May 2004 Posts: 51 Topics: 25 Location: My House
Posted: Tue Jul 27, 2004 5:55 pm Post subject:
Quote:
OUTREC FIELDS=(1,36,DATE1,C'.TXT',32X)
Koulsu,
I am just curious to know, why the above statement is needed again as it is present in the OUTFIL OUTREC statement.
I have got some other question also.
If I open the dataset which I create from this job in BROWSE mode I could not see the first character of every line. On the other hand if I open in the edit mode it shows properly. What could be the reason ?
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Tue Jul 27, 2004 11:28 pm Post subject:
YSMVS,
What is the Record format of the SORTOUT / SORTIN you are using ? Is it FBA by any chance ? If so, then you will not be able to see the first column in browse mode since it treats the first col as the ANSI Carriage control char (used for page breaks & line breaks). Change the RECFM to FB. It should work.
If not, please post the JCL you are using. 'cas I could not see any problem in kolusu's solution.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum