View previous topic :: View next topic
|
Author |
Message |
chhabraravneet
New User
Joined: 04 Oct 2007 Posts: 49 Location: Mumbai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
chhabraravneet
New User
Joined: 04 Oct 2007 Posts: 49 Location: Mumbai
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Using Rexx you can check when a file was created it is applicable to Gdg generation aswell |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|