MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy files where the entrance can be in many files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Tue May 25, 2004 6:13 am    Post subject: Copy files where the entrance can be in many files Reply with quote

Hello,

i need to copy one member of a file. The problem is that member could be in 4 differents files.

For example: i need to copy the member XXXX and this member can be in FILEA or FILEB or FILEC or FILED.
Imagine, for example a REPRO where the entrance is:
Code:

//ENT1 DD DSN=FILEA(XXXX),DISP=SHR
//              DSN=FILEB(XXXX),DISP=SHR
//              DSN=FILEC(XXXX),DISP=SHR
//              DSN=FILED(XXXX),DISP=SHR

If the utility can not find the member in FILEA, it doesn't abend, it continue finding the member into FILEB, etc...
When the utility finds the member, it executes the copy and finishes.

Is it possible?

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue May 25, 2004 6:39 am    Post subject: Reply with quote

Monaco,

If you have file-aid at your shop then the following JCL will give you the desired results. Just concatenate all the PDS to the DD name and file-aid will automatically search for the member.

Code:

//STEP0050 EXEC PGM=FILEAID
//SYSPRINT DD  SYSOUT=*                                 
//SYSLIST  DD  SYSOUT=*                                 
//DD01     DD  DSN=FILEA.PDS,
//             DISP=SHR                                 
//         DD  DSN=FILEB.PDS,
//             DISP=SHR
//         DD  DSN=FILEC.PDS,
//             DISP=SHR
//         DD  DSN=FILED.PDS,
//             DISP=SHR
//DD01O    DD  DSN=YOUR OUTPUT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(1,1),RLSE),
//             DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)
//SYSIN    DD  *                                       
$$DD01 COPY MEMBER=XXXX                           
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Tue May 25, 2004 11:28 am    Post subject: Reply with quote

The FILE-AID has failed.
The output says:

Code:

--------------------------------------------------------------------------
DD01     DSN=AIS.S2DEVE1B.COPY OPENED AS PO,                                   
RECFM=FB,LRECL=80,BLKSIZE=27920,VOL=MONA09                       

DD01O    DSN=RSA174.KTPLCW00 OPENED AS PS,                                     
RECFM=FB,LRECL=80,BLKSIZE=27920,VOL=MONA09                       

$$DD01 COPY MEMBER=KTPLCW00                                             0028000
ER048-OPEN ERROR 780-01 WAS ENCOUNTERED ON DD01                               
.....SKIPPING TO NEXT $$DD CARD                                          RC=4 
                                                                               
0 RECORDS WRITTEN TO DD01O-RSA174.KTPLCW00                                     
                       VOL=MONA09                                             
---------------------------------------------------------------------------


If it finds the member into the first one, OK but if not the process fails.

Kind regards.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue May 25, 2004 11:51 am    Post subject: Reply with quote

Monaco,

The job I posted runs without any problem. The error you are getting is due to the open problem. i.e The dataset is not available for file-aid. Also make sure that you concatenating all like datasets .i.e PDS only. Do not mix panavalet datasets with regular pds.

Why don't you post the JCL you are running and also the dcb parameters of the input PDS's

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Tue May 25, 2004 12:29 pm    Post subject: Reply with quote

You are right.
Now it is working:
Code:

//STEP00   EXEC PGM=FILEAID                           
//SYSPRINT DD  SYSOUT=*                               
//SYSLIST  DD  SYSOUT=*                               
//DD01     DD  DSN=RSA076.FILEAID.PRUEBA1,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA2,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA3,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA4,DISP=SHR     
//DD01O    DD  DSN=RSA007.DEV.JCLLIB,DISP=SHR         
//SYSIN    DD  *                                       
$$DD01 COPY MEMBER=PEPE                               
/*                                                     


But, if we change the output file (PDS also),
Code:

//STEP00   EXEC PGM=FILEAID                           
//SYSPRINT DD  SYSOUT=*                               
//SYSLIST  DD  SYSOUT=*                               
//DD01     DD  DSN=RSA076.FILEAID.PRUEBA1,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA2,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA3,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA4,DISP=SHR     
//DD01O    DD  DSN=RSA076.FILEAID.SALIDA,DISP=SHR     
//SYSIN    DD  *                                       
$$DD01 COPY MEMBER=PEPE                               
/*     

we found a error:

Code:

     PROGRAM AND ALL MATERIAL COPYRIGHT 1980,2000 BY COMPUWARE CORPORATION     
1...5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80
                                                                               
DD01     DSN=RSA076.FILEAID.PRUEBA1 OPENED AS PO,                               
             RECFM=FB,LRECL=80,BLKSIZE=27920,VOL=MONA08                         
DD01O    DSN=RSA076.FILEAID.SALIDA OPENED AS PO,                               
             RECFM=FB,LRECL=80,BLKSIZE=27920,VOL=MONA0I                         
$$DD01 COPY MEMBER=PEPE                                                 00280000
ER048-OPEN ERROR 780-01 WAS ENCOUNTERED ON DD01                                 
.....SKIPPING TO NEXT $$DD CARD                                          RC=4   
                                                                               
0 RECORDS WRITTEN TO DD01O-RSA076.FILEAID.SALIDA                               
                       VOL=MONA0I                                               
                                                                               

Why it happens, if both files are PDS?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue May 25, 2004 12:47 pm    Post subject: Reply with quote

Monaco,

The Job I posted above will run without any problem even if the output is a PDS. My guess is that your output pds RSA076.FILEAID.SALIDA is corrupted.

Try the following

Allocate a new PDS RSA076.New.PDS using 3.2 with the following attributes.
Code:

   Data class . . . . . .    
    Space units . . . . .    CYLINDER         
                                           
    Average record unit                        
    Primary quantity  . .    1             
    Secondary quantity       2             
    Directory blocks  . .    5               
    Record format . . . .    FB               
    Record length . . . .    80                
    Block size  . . . . .    8000             
    Data set name type  :    PDS              



Now submit the following Job

Code:

//STEP00   EXEC PGM=FILEAID                           
//SYSPRINT DD  SYSOUT=*                               
//SYSLIST  DD  SYSOUT=*                               
//DD01     DD  DSN=RSA076.FILEAID.PRUEBA1,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA2,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA3,DISP=SHR     
//         DD  DSN=RSA076.FILEAID.PRUEBA4,DISP=SHR     
//DD01O    DD  DSN=RSA0076.NEW.PDS,DISP=SHR         
//SYSIN    DD  *                                       
$$DD01 COPY MEMBER=PEPE                               
/*                                     


The job should run without any problems.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Tue May 25, 2004 12:55 pm    Post subject: Reply with quote

It was ok.

Thanks.

You has been very useful.

We have also found another way:
Code:

//STEP00   EXEC PGM=IEBCOPY                             
//SYSPRINT DD  SYSOUT=*                                 
//IN01     DD  DSN=RSA076.FILEAID.PRUEBA2,DISP=SHR     
//IN02     DD  DSN=RSA076.FILEAID.PRUEBA1,DISP=SHR     
//IN03     DD  DSN=RSA076.FILEAID.PRUEBA3,DISP=SHR     
//IN04     DD  DSN=RSA076.FILEAID.PRUEBA4,DISP=SHR       
//SYSUT3   DD  UNIT=SYSDA,SPACE=(TRK,(10))             
//OUTX     DD  DSN=RSA076.FILEAID.SALIDA,DISP=SHR           
//SYSIN    DD  *                                       
 COPERST1 COPY O=OUTX,I=(IN01,IN02,IN03,IN04)           
         SELECT  MEMBER=((HOLA,,R))                     
/*                                                     

Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group