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
 

 

PS File copying in bulk

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Jan 11, 2008 8:24 pm    Post subject: PS File copying in bulk
Reply with quote

Hi ALL,
I have a PS file which contains names of 30 plan files. I need to copy these 30 plan files to other files whos names are listed in an another PS file with same order. All the files having their names in 2nd PS file are to be created.
Can this be done thru DFSORT/ICETOOL or anyother utility of JCL ?

PS File1
Code:

FIRST.FILE
SECOND.FILE
.
.
THIRTYTH.FILE


PS File2
Code:

FIRST.FILE.NEW
SECOND.FILE.NEW
.
.
THIRTYTH.FILE.NEW


--Parag
Back to top
View user's profile Send private message

Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Fri Jan 11, 2008 9:16 pm    Post subject: Reply to: PS File copying in bulk
Reply with quote

You can use a simple REXX program also to achieve this.

Regards,
ganesh
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 11, 2008 10:05 pm    Post subject:
Reply with quote

I'm not sure if there's a better way or not, but you could use DFSORT to generate an ICETOOL job for the internal reader that would do it. The generated ICETOOL job would look like this:

Code:

//COPYPS JOB ...
//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//TOOLIN DD *
COPY FROM(IN01) TO(OUT01)
COPY FROM(IN02) TO(OUT02)
...
COPY FROM(IN30) TO(OUT30)
/*
//IN01 DD DSN=FIRST.FILE,DISP=SHR
//IN02 DD DSN=SECOND.FILE,DISP=SHR
...
//IN30 DD DSN=THIRTYH.FILE,DISP=SHR
//OUT01 DD DSN=FIRST.FILE.NEW,DISP=(NEW,CATLG,DELETE),...
//OUT02 DD DSN=SECOND.FILE.NEW,DISP=(NEW,CATLG,DELETE),...
...
//OUT30 DD DSN=THIRTYH.FILE.NEW,DISP=(NEW,CATLG,DELETE),...


You could use DFSORT to generate the COPY operators and INxx DD statements from input file1. You could use DFSORT to generate the OUTxx DD statements from input file2. You could use DFSORT to construct the job from the pieces and submit it to the internal reader.

If you want me to show you how to do it, show me a model for the //OUT01 DD statement to create the first output data set.
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Fri Jan 11, 2008 10:19 pm    Post subject:
Reply with quote

If the requirement is not restricting to use only ICETOOL then this REXX code can be used.


Code:
/*rexx*/                                                               
/*-------------------------------------------------------------------*/
/* This will copy the files listed in first PS file to the files     */
/* listed in second PS file                                          */
/* first file in first PS file is copied to first file in Second PS  */
/* file and so on                                                    */
/*-------------------------------------------------------------------*/               
"execio * diskr file1 (stem read1. finis"                             
"execio * diskr file2 (stem read2. finis"                             
do i = 1 to read1.0
   indsn = word(read1.i,1)                                             
   outdsn= word(read2.i,1)                                             
   "copy '"indsn"' '"outdsn"'"                                         
end


Regards,
Ganesh
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Mon Jan 14, 2008 2:23 pm    Post subject:
Reply with quote

Thanks a lot Guys !!!! I will try them !
icon_biggrin.gif
--Parag
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Jan 22, 2008 7:47 pm    Post subject:
Reply with quote

Hi Ganesh,
I had to modify your rexx code as follows. It works fine gives desired results.
But tell me how do I check the status of job while its running, the way we check in spool for JCLs.
Code:

/*REXX*/                                                               
/*-------------------------------------------------------------------*/
/* THIS WILL COPY THE FILES LISTED IN FIRST PS FILE TO THE FILES     */
/* LISTED IN SECOND PS FILE                                          */
/* FIRST FILE IN FIRST PS FILE IS COPIED TO FIRST FILE IN SECOND PS  */
/* FILE AND SO ON                                                    */
/*-------------------------------------------------------------------*/                   
"EXECIO * DISKR FILE1 (STEM READ1. FINIS"                               
"EXECIO * DISKR FILE2 (STEM READ2. FINIS"                               
DO I = 1 TO READ1.0                                                     
   INDSN = WORD(READ1.I,1)                                             
   OUTDSN= WORD(READ2.I,1)                                             
   "COPY '"INDSN"' '"OUTDSN"'"                                         
END                                                                     
EXIT 0                                                                 


--Parag
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Jan 22, 2008 7:50 pm    Post subject: Reply to: PS File copying in bulk
Reply with quote

Interesting, especially since COPY is not a standard TSO command.
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Tue Jan 22, 2008 9:32 pm    Post subject:
Reply with quote

Parag,

You can insert the SAY commands before and after "COPY" statement, which will display the output on screen if you are invoking in foreground. If you are executing this REXX it through JCL, then it will display the output of SAY commands in spool.

Code:
/*REXX*/                                                               
/*-------------------------------------------------------------------*/
/* THIS WILL COPY THE FILES LISTED IN FIRST PS FILE TO THE FILES     */
/* LISTED IN SECOND PS FILE                                          */
/* FIRST FILE IN FIRST PS FILE IS COPIED TO FIRST FILE IN SECOND PS  */
/* FILE AND SO ON                                                    */
/*-------------------------------------------------------------------*/                   
"EXECIO * DISKR FILE1 (STEM READ1. FINIS"                               
"EXECIO * DISKR FILE2 (STEM READ2. FINIS"                               
DO I = 1 TO READ1.0                                                     
   INDSN = WORD(READ1.I,1)                                             
   OUTDSN= WORD(READ2.I,1) 
    SAY 'COPYING ' INDSN                                       
   "COPY '"INDSN"' '"OUTDSN"'"     
    SAY 'COPIED ' INDSN ' TO ' OUTDSN                                   
END                                                                     
EXIT 0
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Wed Jan 23, 2008 2:11 pm    Post subject:
Reply with quote

Ganesh,
Lots of thanks for your help ! icon_biggrin.gif
But as I'm new to REXX, may I please request you to give total code (JCL + REXX) and tell me how to execute that ! Also I want return code with proper message if possible in case of abend or error.

--Parag
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Wed Jan 23, 2008 7:25 pm    Post subject: Reply to: PS File copying in bulk
Reply with quote

Parag,

You can use IKJEFT01 to execute your REXX program in batch. specify the REXX exec member name in SYSTSIN.

Code:
//STEP001  EXEC PGM=IKJEFT01               
//SYSEXEC  DD DISP=SHR,DSN=your.rexx.library
//SYSPRINT DD SYSOUT=*                     
//SYSTSPRT DD SYSOUT=*                     
//SYSTSIN  DD *                           
 %member                             
/*
//FILE1 DD DSN=file1,DISP=SHR
//FILE2 DD DSN=file2,DISP=SHR

I am also not sure how to pass the return code from REXX program to the JCL.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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