How to copy all members that have a 'C' as the third character in the member name from a Librarian Master file to a PDS
search cancel

How to copy all members that have a 'C' as the third character in the member name from a Librarian Master file to a PDS

book

Article ID: 68570

calendar_today

Updated On:

Products

Librarian

Issue/Introduction

Need to copy all members that have a 'C' as the third character in the member name from a Librarian Master file to a PDS. 
 
Is there a way to do this?
 
 
 

Environment

Release: 4.4
Component:  Librarian

Resolution

Use the -SEL NAME=/string,n/ search statement - where the first parm is the character string to be searched for and the second parm is the position.

Using the search criteria with the -SEL NAME statement the search starts at the beginning of the member name in position 0.  

Searching for a character in position 3 of the member name the -SEL NAME statement would be -SEL NAME=/C,2/,EXEC.

The batch JCL to select, search and copy to a PDS is a two step GPO process.

Example below:
 
//STEP1 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA' 
//STEPLIB DD DISP=SHR,DSN=YOUR.LIBRARIAN.CALJLINK 
//SYSPRINT DD SYSOUT=* 
//MASTER DD DISP=SHR,DSN=YOUR.LIBRARIAN.MASTER.FILE 
//OSJOB DD DSN=&&GPO,DISP=(,PASS),UNIT=SYSDA, 
// SPACE=(CYL,(1,1)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000) 
//SYSIN DD * 
-OPT GPO 
-SEL NAME=/C,2/,EXEC 
-END 
/* 
//STEP2 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA' 
//STEPLIB DD DISP=SHR,DSN=YOUR.LIBRARIAN.CALJLINK  
//SYSPRINT DD SYSOUT=* 
//OSJOB DD DSN=YOUR.PDS.DATASET, 
// DISP=(,CATLG), 
// UNIT=3390,DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB), 
// SPACE=(CYL,(75,25,30),RLSE) 
//MASTER DD DISP=SHR,DSN=YOUR.LIBRARIAN.MASTER.FILE  
//SYSIN DD DSN=&&GPO,DISP=OLD 
//  
 
 
 
 
 

Additional Information

For more information on GPO see Librarian TechDocs:

https://techdocs.broadcom.com/us/en/ca-mainframe-software/devops/ca-librarian/4-4/system-services/group-processing-option-gpo/gpo-control-statement-syntax.html