Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Batch JCL to Copy from Unix Directory to another Directory

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 172
Location: India

PostPosted: Tue May 19, 2020 7:53 pm    Post subject: Batch JCL to Copy from Unix Directory to another Directory
Reply with quote

Hi All,

Hope you are all doing well..!! Thanks for your support in adavance.

I have a requirement to copy a Unix directory and all its subdirectoires into another directory. In other words, kind of backup creation (like, cp -r <source> <target>).

Target directory and subdirectories needs to be created dynamically.

I need to complete this task using batch JCL. I tried to understand OCOPY, OPUT, OPUTX commands but didn't get any clear syntax/understanding from my search.

Could you please help in this regard?
Back to top
View user's profile Send private message

Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 306
Location: Bamberg, Germany

PostPosted: Tue May 19, 2020 8:08 pm    Post subject:
Reply with quote

Have a look at the pax command.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 172
Location: India

PostPosted: Tue May 19, 2020 8:39 pm    Post subject:
Reply with quote

Hi Joerg.Findeisen,

Thanks for the quick reply.

I am looking for Mainframe Batch JCL/JOB option to perform this task.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 172
Location: India

PostPosted: Tue May 19, 2020 8:43 pm    Post subject:
Reply with quote

I am going to search with PAX + BPXBATCH and will see if a get a suitable example...

Will keep you posted here..
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 306
Location: Bamberg, Germany

PostPosted: Tue May 19, 2020 11:31 pm    Post subject:
Reply with quote

Code:
//SCRIPT   EXEC PGM=BPXBATCH,                                 
//         PARM='sh <your shell_script or unix command> 2>&1'                           
//STDOUT   DD PATH='/tmp/my.log',                           
//         PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU   
//COPYLOG  EXEC PGM=IKJEFT01                                 
//JES      DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=256)             
//LOG      DD  PATH='/tmp/my.log',                           
//             PATHOPTS=ORDONLY                               
//SYSTSPRT DD  DUMMY                                         
//SYSTSIN  DD  *                                             
  OCOPY INDD(LOG) OUTDD(JES)                                 
/*                                                           
//CLEANUP  EXEC PGM=BPXBATCH,                                 
//         PARM='sh rm /tmp/my.log'
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 172
Location: India

PostPosted: Wed May 20, 2020 2:03 am    Post subject:
Reply with quote

Thank you so much Joerg.Findeisen.

Sample JCL worked for me without any issues.

Once again, thanks a lot. icon_biggrin.gif
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 current batch plan jzhardy DB2 3 Sun Sep 13, 2020 11:04 am
No new posts VSAM Open During Copy-Excessive EXCP ... David Beckham JCL & VSAM 1 Sat Jun 27, 2020 5:23 pm
No new posts ISPF Edit Macro with profile commands... Lynne Schuler TSO/ISPF 14 Thu Jun 18, 2020 7:25 pm
No new posts File Manager Copy narinder4075 IBM Tools 1 Thu Apr 30, 2020 9:15 pm
No new posts Java Batch launcher JVMPRC86 does not... harisukumaran IBM Tools 2 Wed Apr 15, 2020 12:37 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us