Page 1 of 1

Issue in fetching the files using MGET

PostPosted: Thu Mar 29, 2018 12:15 pm
by Papya013
Hi Team,

I have a requirement from my business user to get multiple files from the FTP on Mainframe GDG files.

I tried using the below mentioned code. But The GDG file is not getting created.

LOCSITE REC=FB LR=80 BL=27920    
lcd 'SETT'                      
MGET S8* 'SETT.S8.FTP.IN.BST(+1)'


Could you please let me know if any suggestions to correct the issue.

Regards,
Balesh GG

Re: Issue in fetching the files using MGET

PostPosted: Thu Mar 29, 2018 5:06 pm
by Robert Sample
From the IP User's Guide and Commands manual for version 2.1 of z/OS:
Before you specify a (+nnn) value to create a new GDS, issue the following command:

SITE DCBDSN=model

This subcommand specifies an MVS™ data set to be used as a model. The model must have a DSORG of PS. The other DCB characteristics of the data set are not checked.
Notes:

Failure to have a valid DCBDSN before trying to create a new GDS might cause FTP or ALLOCATION to fail or to return unpredictable results.
If you issue a SITE DCbdsn LRecl BLKsize command before the creation of a new data set, the LRecl and BLKsize parameters on the SITE command override the LRecl and BLKsize parameters on the DCbdsn command.
Depending upon your FTP, you may need LOCSITE instead of SITE. And you may need to put QUOTE before either command. It is not clear how you expect the MGET to work -- do you think each retrieved file from the server system will be a new generation?

Re: Issue in fetching the files using MGET

PostPosted: Thu Mar 29, 2018 5:34 pm
by Papya013
Hi Robert,

Thanks for your quick response.

Could you please let me know the syntax for the statement "And you may need to put QUOTE before either command".

Yes, each file retrieved from the server is expected to be in a new generation.

Regards,
Balesh GG

Re: Issue in fetching the files using MGET

PostPosted: Thu Mar 29, 2018 7:45 pm
by Robert Sample
QUOTE SITE and QUOTE LOCSITE are used to pass site or local site commands without the FTP server on the other end of the connection attempting to deal with them. The QUOTE says for the FTP server to not attempt to parse / process the commands or options.

I've never attempted to use MGET with a GDG, so I have no idea what will happen. I suspect, though, that your first file will be retrieved and written to the GDG as the +1 generation. The next file will be retrieved and FTP will attempt to write it to the GDG as the +1 generation -- at which time an error will occur or the previously transferred file with be overwritten with the "new" +1 generation (I'm not sure which will occur).