Release: 4.4
Component: Librarian
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.
//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//
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