Monday 11 March 2013

FTP(Part-2) : Passing Parameters to FTP in batch


Passing parameters to FTP in batch:

For people using FTP in batch all valid options can be passed to ftp as PARAMETERS:

Example of running ftp in batch and passing parameters:

//FTP00001 EXEC PGM=FTP,REGION=6144K,                     
//         PARM='dropbox.test.com (EXIT TIMEOUT 720'   
//SYSPRINT DD SYSOUT=*                                    
//OUTPUT   DD SYSOUT=*                                    
//INPUT    DD DSN=M0001.TEST.SCRIPT(+1),DISP=SHR      

Note that in the above example parameters we are passing the remote server name, the EXIT parameter and timeout parameter set to 720 seconds.

When running FTP in MVS using TSO or BATCH, the input to the FTP is provided using the file specified in the DDNAME INPUT.
Also Output is directed to the dataset specified by the DDNAME OUTPUT.

When running in TSO check is made to see whether a data set is allocated to INPUT. If a data set is allocated, subcommands are read from that data set rather than from your terminal. Similarly, a check is also made to see whether a data set is allocated to OUTPUT. If so, all FTP prompts and replies are written to that data set rather than to your terminal.

When running in BATCH as shown above the OUTPUT is generally directed to SYSOUT.

When Input and Output datasets are used following are the guidelines:
1)    Specify the INPUT data set:
·        Record format=FB.
·        Logical record length=2080.
The logical record length of the input data set can be any value in the range 80 - 2080.
·        Block size is a multiple of logical record length.

2)    Specify the OUTPUT data set:
·        Record format=FB.
·        Logical record length=160.
·        Block size is a multiple of 160.



NOte : All the information about FTP and the syntax diagrams are taken from the site http://publib.boulder.ibm.com.
Things are put here in simplified words and Many commands that are not used normally are omitted.
Refer the website http://publib.boulder.ibm.com. in case you need more details.

No comments:

Post a Comment