Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10326
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: 1542
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: 1542
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: 10326
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us