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

SFTP to primary and secondary servers


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Tue Jun 07, 2016 12:52 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Jun 07, 2016 3:35 pm
Reply with quote

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
View user's profile Send private message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Tue Jun 07, 2016 4:01 pm
Reply with quote

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
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 197
Location: UK

PostPosted: Wed Jun 08, 2016 3:23 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2590
Location: NYC,USA

PostPosted: Wed Jun 08, 2016 8:43 pm
Reply with quote

Please search the forum before you post. Nic already told you the options but still.
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 Secondary index error while loading d... IMS DB/DC 2
No new posts SFTP replacement for LOCSITE ASA in FTP All Other Mainframe Topics 7
No new posts Can we Insert duplicates in Primary U... DB2 2
No new posts How to remove remote file older than ... All Other Mainframe Topics 4
No new posts Issue in SFTP a file All Other Mainframe Topics 1
Search our Forums:

Back to Top