Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to Skip "File Not Found' Error in the FTP step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Thu Jan 31, 2013 1:39 am    Post subject: How to Skip "File Not Found' Error in the FTP step
Reply with quote

Hi,
I am trying to FTP 3 files to a XYZ server.

My requirement is :

1. First check if the File is present or not.
2. If the file is present, then only FTP those files.

3. If the file is not present, generally it gives MAXCC = 2424, status code 27000, return code = 18. But somehow i need to bypass this condition.
I mean FTP only those files which are present and forgot about the rest files..and give a maxcc = 0 instead of maxcc = 2424.

Is this possible ?

Any suggestions would be of great help.

Thanks.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Jan 31, 2013 1:45 am    Post subject: Reply to: How to Skip "File Not Found' Error in the FTP
Reply with quote

Quote:
1. First check if the File is present or not.
2. If the file is present, then only FTP those files.


are You doing a PUT or a GET

for a PUT just split the process in 2 steps
1) determine the files to be transmitted and build the FTP control cards accordingly
2) run the FTP step using the above control cards

for a GET You will have to completely script Your FTP session
( Pretty easy to do it in REXX )
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Thu Jan 31, 2013 1:49 am    Post subject:
Reply with quote

Step 1 Check for existance of file using rexx set return code based on existence
Step 2 Based on return code execute

Edit: Sorry Enrico I was too fast :-(
Back to top
View user's profile Send private message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Thu Jan 31, 2013 1:58 am    Post subject: Reply to: How to Skip "File Not Found' Error in the FTP
Reply with quote

Thanks for the prompt response.

I am using PUT.

Here is the control card that i am using in my FTP step:
cd shrdata "path "
dir
put 'clwc.tw1000a3(+0)' clwc_xyz.txt
put '@tcpa1p.CDFWC.MASTER(+0)' clwc_control_total.txt
put 'clwc.tw1000a2(+0)' clwc_abc.txt
dir
cd
quit

My issue here is, lets suppose i have the first file and the second and third files are not present.
Now since this is a GDG, when i will submit my FTP step, it will try to search for the current generation. If the current generation is not present, then it will assume last generation as the current generation..and this way i will never get a File not found condition as it will FTP the previous file only.
I am not sure how to take care of this scenario. Do i need to change the file from GDG's and then FTP ? i gues that will be too long.

is it possible that i FTP all the generations correctly and make sure if the current generation if not present, it does not take the previous generation as the current and FTP the file..

thanks for your time.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Thu Jan 31, 2013 2:04 am    Post subject:
Reply with quote

Using Rexx you can check when a file was created it is applicable to Gdg generation aswell
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Jan 31, 2013 2:14 am    Post subject: Reply to: How to Skip "File Not Found' Error in the FTP
Reply with quote

Quote:
If the current generation is not present, then it will assume last generation as the current generation..and this way i will never get a File not found condition as it will FTP the previous file only.


wiser to review Your understanding/handling of GDG terminology

a non empty GDG will ALWAYS have a <current> generation the zeroth one

so You are out of luck

on the forum there are quite a few examples/snippets of REXX scripts reading a dataset list and finding out if they exist or not

search for IGGCSI
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us