IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 31, 2013 1:45 am
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

Global Moderator


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

PostPosted: Thu Jan 31, 2013 1:49 am
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
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

Global Moderator


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

PostPosted: Thu Jan 31, 2013 2:04 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 31, 2013 2:14 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top