Saturday, September 20, 2008

Batch JCL to FTP

//FTP00001 EXEC PGM=IKJEFT01,DYNAMNBR=50
//OUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSPRINT DD DUMMY
//OUTPUT DD SYSOUT=*
//INPUT DD *
IP Address
Userid
password
pwd
ascii
Your Pc Path
pwd
GET 'YOUR.MAINFRAM.FILE' YOUR_PC_FILE.TXT
QUIT
/*
//SYSTSIN DD *
FTP (EXIT
/*

JCL TO FTP FROM TEST SITE TO PRODUCTION

//STEP0100 EXEC PGM=FTP
//SYSPRINT DD SYSOUT=*
//INPUT DD *
ip addr of prod datacenter
userid
password
LOCSITE LRECL=nnn
LOCSITE BLKSIZE=nnnnn
LOCSITE RECFM=FB
PUT 'your test ftp file' 'your prod ftp file'
//OUTUT DD SYSOUT=*
//*

Here is a simple rexx exec to find the ip address

Code:

/* REXX */
PARSE VALUE SOCKET('INITIALIZE', 'TEST') WITH RC . . SERVER
PARSE VALUE SOCKET('GETHOSTID') WITH RC IP
SAY IP
EXIT

How to transfer a dataset from mainframe to PC thru FTP ?

How to transfer a dataset from mainframe to PC thru FTP ?

1) Find the IP address of the mainframe system you are transmitting from.
Go ot ISPF option 6(command)
- type PING DIPN then hit ENTER
- Look for a message like the one below to find the IP address
148.171.100.2

2) Go to a DOS Prompt (COMMAND PROMPT in WINDOWS 2000) on your PC
- Type FTP then hit ENTER
- Type OPEN 148.171.100.2(i.e ip_address)
- Hit ENTER
- Enter your TSO ID and PASSWORD
- Enter the RECV command to receive the mainframe file down to your PC
RECV 'WXX262.SE.SED103.SE585.NEW' c:\temp\yourfile.txt
- Type CLOSE and hit ENTER
- Type BYE then hit ENTER to exit