//SYSPFTP JOB 090000,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID,
// REGION=3072K
//*
// SET DATE=1125
//*
//FTP EXEC PGM=FTP
//OUTPUT DD SYSOUT=*
//SYSIN DD *
// DD DSN=SYSP002.JCLLIB(INFO),DISP=SHR *my user id and password
// DD *
LCD JCLLIB
CD ABC
CD ABB
PUT TEST TEST.D&DATE
QUIT
/*
My jcl above is to ftp (put/get) from mainframe to server.
1- I can get connected but the date variable did not follow variable set.
2- And is it possible for the date to get the current date.
:!:
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
zahari, my apologies, but it appears I may have been misleading you. A quick test showed that FTP does not substitute the dataset name as the target dataset when using the PUT command as I originally showed.
khamarutheen is correct in stating that you will have to supply the target filename. It looks like you will have to write the code, or use a standard utility program, to generate the required PUT statement with an appropriate date value.
The REXX JCL works as my requirement.
Need another help on how to shorten the JCL since we have many FI (more 25). If I put all FI (cd FI1, cd FI2 ... and then the GET/PUT command) it going to be lenghty (see below JCL).
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
Code:
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
Why 4 PUT's of the same dataset to the same filename?
Then why not use a language/utility that you ARE familiar with? The process is the same:
- Get the date value from the PARM <or>
- Use the current system date.
- Build the FTP GET or PUT records.
- Write the records to an output DD.
- Use those GET/PUT records in the FTP step.
I'm new with this JCL and REXX. My expertise is more to Windows application area. I have a VB program doing the Job all the while, but the management has decided to run the Job from the mainframe instead of Server for a security reason. So here I am, struggling with this new line.
I hope you can understand.
And for :
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
PUT 'SYSP002.TEST.MNCABB' MRT"ARG(1)A.TXT
You are right the put should put different dataset to a different files. I have copied the wrong line. Sorry. Anyway this is what I try to achive:
For each FI1..F2.. F3...n
PUT 'SYSP002.TEST.PRDABB' DIST"ARG(1)A.TXT
PUT 'SYSP002.TEST.PEDABB' DISTREC"ARG(1)A.TXT
PUT 'SYSP002.TEST.PRCABB' COLL"ARG(1)A.TXT
PUT 'SYSP002.TEST.PECABB' COLLREC"ARG(1)A.TXT