Hi,
I have to FTP my file from mainframe to WINDOWS server. I am using the following JCL to do the same but the problem is - even if the FTP fails, MAXCC from JCL is always kept zero. So looking at the MAXCC, I can not get an idea whether my FTP ran successfully. Can you please let me know the way to trap return-code from FTP processing so that I can set that for my JCL return-code. For details, refer my JCL below -
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
Rather than posting the fairly useless (for solving your problem at least) JCL, why don't you post an actual output showing the FTP output as well as the JES messages showing the return code for the FTP step? And post one that didn't work so we can have something to work with. Replace the key data like IP address with * to keep it hidden, but give us the actual data to look at. Thanks.
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
Kevin, I was heading there (slowly). As the guide says,
Quote:
By default, the FTP client ignores any errors that occur during a session and exits with a return code of zero.
Jain.eti: since you're connecting to a Windows server, the mainframe is a client in this case. As you've specified the job, you will ALWAYS get a zero return code (or MAXCC as you call it).
Robert for you - refer the output message we got in the spool -
Code:
EZA1736I FTP
EZY2640I Using dd:SYSFTPD=PSCZAYC.TCPPARMS(FTPDATA) for local site configuration
EZA1450I IBM FTP CS V1R7
EZA1466I FTP: using TCPIP
EZA1456I Connect to ?
EZA1736I 10.131.133.43
EZA1554I Connecting to: 10.131.133.43 port: 21.
EZA2589E Connection to server interrupted or timed out. Initial connection
EZA1460I Command:
EZA1618I Unknown command: 'if(rc'
EZA1619I For a list of the available commands, say HELP
EZA1460I Command:
EZA1736I LSMASTER\PARGYRIS
EZA1618I Unknown command: 'lsmaster\pargyris'
EZA1460I Command:
EZA1736I earie444
EZA1618I Unknown command: 'earie444'
EZA1460I Command:
EZA1736I CD FTP_DL
EZA1457I You must first issue the 'OPEN' command
EZA1460I Command:
EZA1736I PUT //DD:FTPIN DLY@EVTS-20080505-0015.TXT
EZA1457I You must first issue the 'OPEN' command
EZA1460I Command:
EZA1736I QUIT
By the way, I manipulated a random IP so that this JCL does not touch our production server and replace the file present on the server.
I am going thru the link sent by Superk, but Robert, did you mean by your comment -
Quote:
Jain.eti: since you're connecting to a Windows server, the mainframe is a client in this case. As you've specified the job, you will ALWAYS get a zero return code (or MAXCC as you call it).
- that we can not trap the FTP return code so that we can populate the code to JCL return code?
Superk, as mentioned by you to use EXIT command, I used the command but received the following output in the spool -
Code:
EZA1736I FTP
EZY2640I Using dd:SYSFTPD=PSCZAYC.TCPPARMS(FTPDATA) for local site configuration
EZA1450I IBM FTP CS V1R7
EZA1466I FTP: using TCPIP
EZA1456I Connect to ?
EZA1736I 10.138.100.51
EZA1554I Connecting to: 10.138.100.51 port: 21.
220-Microsoft FTP Service
220 Tufts Medical Center
EZA1459I NAME (10.138.100.51:PSCZAYC):
EZA1701I >>> USER LSMASTER\PARGYRIS
331 Password required for LSMASTER\PARGYRIS.
EZA1789I PASSWORD:
EZA1701I >>> PASS
530 User LSMASTER\PARGYRIS cannot log in.
EZA1460I Command:
EZA1736I CD FTP_DL
EZA1701I >>> CWD FTP_DL
530 Please login with USER and PASS.
EZA1460I Command:
EZA1736I EXIT
EZA1618I [b]Unknown command: 'exit'[/b]
EZA1619I For a list of the available commands, say HELP
EZA1460I Command:
EZA1736I QUIT generated by unexpected end of file
EZA1701I >>> QUIT
221 Leaving the MFrame Environment
Refer the output - you will see that FTP fails to understand the command. How is it possible? Am I missisng something?
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
Code:
//STEP001 EXEC PGM=FTP,REGION=5M,PARM='(EXIT'
It's not an FTP command, it's a parameter passed to FTP. If you leave the PARM='(EXIT' off your JCL, you will always get a zero return code from a client FTP. If you add it, the FTP return code in the JCL will be the 5-digit FTP code (2 digit command code and 3 digit response code), converted into a return code. For example, a GET fails with a FILE NOT FOUND message. This translates into an FTP code of 16550. 16550 modulo 4096 is 0166, which will be the return code for the FTP step.
Guys sorry for the confusion raised by me - I am sorry!
I checked with some other post in this forum itself and found out the actual syntax of EXIT.
For your info, I modified the JCL in the following way -
But as I mentioned earlier, I am not very much clear from the previous discussion whether this will populate the return-code of JCL if the FTP does not run successfully?