View previous topic :: View next topic
|
Author |
Message |
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
hi,
We are developing a JCL to transfer a file to some UNIX server. If this transfer fails for some reason, we would like JCL to transfer the file to secondary sever.
Currently we have 2 different JCL steps to achieve this like below. Second step will check the CONDITION CODE of STEP1 and if it is more than ZERO then it will get executed.
STEP1:
SFTP to primary server
STEP2: (execute only when cond code of STEP1 > 0)
SFTP to Secondary server
Problem with this code is, the MAXCC of the JCL will be same as the return code of failed step (STEP1). But logically if you see the file is transferred to the destination. Lets say STEP1 has failed with return code 3804 and STEP2 completed with ZERO, the JCL MAXCC is 3804 and CA-7 will consider it as ABEND. Can any one let me know how to club 2 SFTP scripts in a single BPXBATCH step?
I tried IDCAMS step to change the MAXCC. But it will not work as it will change the code only for that particular step.
Thanks,
Mallik |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Don't do it in one job. Each FTP should be in its own job. The second would only be triggered if the first fails.
or
You could also try using the JOBRC facility.
or
You could try telling CA7 that if the last step has a completion code of 000 then the job is successfull. |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Thank you Nic for quick reply.
I like "You could try telling CA7 that if the last step has a completion code of 000 then the job is successfull" solution. I will discuss with my shop CA7 team about it.
Regards,
Mallik |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Not sure that will work, as the last step will not run if the first FTP is successful?
In TWS you can specify that a particular return code from a particular step is not to be treated as an error. So you could say that a rc of 3804 in STEP1 is acceptable, knowing that your job will then go on to STEP2. Not sure if you can do something similar in CA7, but I imagine you can. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Please search the forum before you post. Nic already told you the options but still. |
|
Back to top |
|
|
|