Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SFTP to primary and secondary servers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SFTP to primary and secondary servers
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: 1716
Location: UK

PostPosted: Tue Jun 07, 2016 3:35 pm    Post subject:
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    Post subject:
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: 175
Location: UK

PostPosted: Wed Jun 08, 2016 3:23 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Jun 08, 2016 8:43 pm    Post subject:
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    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 Replacement FTP to SFTP Vasili Koipish All Other Mainframe Topics 1 Wed May 11, 2016 3:10 pm
No new posts SUM file with secondary sorted file cdelaf32 SYNCSORT 9 Mon Apr 25, 2016 10:20 pm
No new posts Rebuilding IMS secondary index withou... Hooman24 IMS DB/DC 6 Tue Mar 29, 2016 12:22 pm
No new posts FTP to SFTP passion_sujesh All Other Mainframe Topics 1 Tue Feb 24, 2015 8:59 am
No new posts Count unique values in a column based... Deepakgoyal2005 JCL & VSAM 4 Fri Jul 25, 2014 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us