Page 1 of 1

Which GDG generation will be FTP'ed?

PostPosted: Fri Mar 01, 2013 5:52 pm
by apjohn1986
Hi Guys,

I have two steps in my job. first step PS05 is creating a new version of the GDG 'TABCCI.INVOICE.REPORT(+1)'. second step is as follows,

//PS10 EXEC PGM=FTP,REGION=4M,PARM='(EXIT',COND=(0,NE)
//INPUT DD DSN=HLCNTL.PROD.CNTLLIB(CIBS037A),DISP=SHR
//OUTPUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=X


below is the data in INPUT file
CD Folder1
PUT 'TABCCI.INVOICE.REPORT(+1)' report.txt


for example if the step PS05 is creating version G0001V00, then what version will be FTP'ed? is it G0001V00 or G0002V00.

Please clarify this.

Re: Which GDG version will be FTP'ed?

PostPosted: Fri Mar 01, 2013 6:46 pm
by Robert Sample
This should be easy for you to test, and you should be testing it as part of the unit test (or system test) process at your site.

When using a JCL statement, you use the same relative generation number throughout the job since that number is interpreted by JES throughout the job. However, since the FTP commands are not in JCL but rather in an input file passed to the FTP started task, using the (+1) in the PUT command will cause FTP to attempt to send the generation G0002V00 and not G0001V00. Since G0002V00 does not exist, this will cause a problem in the FTP.

Re: Which GDG version will be FTP'ed?

PostPosted: Fri Mar 01, 2013 8:27 pm
by steve-myers
As Mr. Sample says, TEST, TEST, TEST!

In my opinion, you are better off not using GDGs with FTP. I think something like this will work OK -
//A       EXEC PGM=...
//NEWGDG   DD  DISP=(NEW,CATLG),DSN=GDG(+1),...
//B       EXEC PGM=FTP,PARM='...'
//SYSIN    DD  *
USER ...
cd ...
put GDG(+1) ...
What you showed probably will work the first time it is run, but I'm pretty certain it will not work the second time unless the mainframe server is shut down and restarted before your example is run the second time.

The reason for my pessimistic analysis is the first time you use a relative GDG generation, either in JCL or dynamic allocation, the relationship between the relative generation and the true data set name is fixed for the life of the job. An FTP server on a mainframe is a single mainframe job. A remote client using the mainframe FTP server multiple times does not define a new JOB for each use.

Re: Which GDG version will be FTP'ed?

PostPosted: Fri Mar 01, 2013 9:32 pm
by MrSpock
I always say, why not allocate the GDG to a DDNAME and just use a "put" from the DDNAME instead?

Re: Which GDG version will be FTP'ed?

PostPosted: Sat Mar 02, 2013 9:43 am
by NicC
Are you creating a new version or generation?

Re: Which GDG version will be FTP'ed?

PostPosted: Mon Mar 04, 2013 12:27 pm
by apjohn1986
@Robert Sample & @steve-myers, we don't have access to test file transfer. that's why i asked that in forum instead of testing it. Thanks for your valuable responses.

@MrSpock, Thanks.

@NicC, i am creating new generation only. sorry for that wrong keyword used at title.

Re: Which GDG generation will be FTP'ed?

PostPosted: Mon Mar 04, 2013 3:23 pm
by Robert Sample
we don't have access to test file transfer
This is complete and utter BS. You do NOT have to test the actual file transfer; set up a GDG on your system and test the FTP commands going from one LPAR to another, or from z/OS to your generic FTP server, or somewhere. If you cannot do any test FTP at all, then why are you even posting here? If you can do a test FTP, then saying you don't have access to test file transfer is lying to this forum.