© 1998-2017 GSF Software LLC |
PDSEDIT is a batch utility program for the MVS/ESA, OS/390 and z/OS environments. PDSEDIT scans data sets for specified character strings and optionally replaces them with new character strings of the same or different lengths. PDSEDIT commands are similar to commonly-used ISPF/PDF EDIT commands, in particular FIND, CHANGE, EXCLUDE and BOUNDS. TSO/ISPF users are generally familiar with these ISPF/PDF EDIT commands which makes it easy for them to use PDSEDIT - they do not have to learn a different set of commands. PDSEDIT processes partitioned data sets (PDS), PDSE, or sequential (non-VSAM) data sets. Currently, PDSEDIT does not support records longer than 256 bytes. PDSEDIT can also process VSAM data sets, but only in read-only mode (PARM=TEST). PDSEDIT mimics certain aspects of the ISPF/PDF editor:
PDSEDIT is a batch utility program controlled via the PARM field of the EXEC JCL statement and SYSIN control statements. |
The format for the PDSEDIT PARM is PARM=mode or PARM=(mode,member).
mode can be specified as TEST, UPDATE or PUNCH. The default is TEST and NOTEST is synonym for UPDATE. In TEST or PUNCH mode, PDSEDIT does not update the data set. In PUNCH mode, PDSEDIT writes updated PDS members to SYSPUNCH as an IEBUPDTE input stream.
member allows specification of a member name, a member name prefix or a range of members. For example:
Member selection is available via the SELECT and EXCLUDE data sets as well.
PDSEDIT requires several DD statements:
PDSEDIT requires the presence of control statements in the SYSIN data set. Use only pos 1 72 of SYSIN records, and specify an "*" in pos 1 to indicate a comment line. The syntax of control statements is similar to the syntax of the BOUNDS, FIND, CHANGE, EXCLUDE and CAPS commands of the ISPF/PDF editor.
Specify the lower and upper boundaries for the search operation. BOUNDS must be specified when:
CAPS ON specifies that a match is detected, whether a specified string appears in upper- or lower-case in the data set's records. CAPS OFF is the default and reduces CPU consumption. Note that the semantics of CAPS are different from the CAPS command of the ISPF/PDF editor. Furthermore, the ISPF/PDF editor normally ignores case when matching strings.
Specifies a FIND command in ISPF/PDF EDIT format. string is the search argument, which can be specified as AAA (a character string), or 'AAA' (a character string enclosed in apostrophes), or "AAA" (a character string enclosed in double quotes), or X'C1B2' (a hexadecimal string), or * which represents the previous string, as specified in an immediately preceding FIND, CHANGE or EXCLUDE command. n and m optionally specify the left and right boundaries of the search.
Specifies a CHANGE command in ISPF/PDF format. old-string is replaced with new-string as would occur in the ISPF/PDF editor.
Specifies an EXCLUDE command in ISPF/PDF format. string is the search argument. EXCLUDE commands are used in conjunction with X|NX operands of the FIND and CHANGE commands.
Exclude commands may be used to specify multiple conditions. When EXCLUDE commands are specified, PDSEDIT scans each SYSLIB record twice, once for the EXCLUDE commands, and a second time for FIND and/or CHANGE. If the following example, EXCLUDE commands are used to ignore COBOL comment lines during a search.
X '*' 7 ; COBOL comment X "/" 7 ; COBOL comment F 'PROGRAM-ID' 8 40 NX ; search non-comment lines
1. Change all occurences of PROD.ESDS and PROD.KSDS to MVS.PROD.ES and MVS.PROD.KS in members PAY345 and BILL578 of the MVSJCL library.
//PDSEDIT EXEC PGM=PDSEDIT,PARM=NOTEST //SYSPRINT DD SYSOUT=* //SYSLIB DD DSN=PRISMCS.LOCAL.MVSJCL,DISP=SHR //SYSIN DD * C PROD.ESDS MVS.PROD.ES ALL C PROD.KSDS MVS.PROD.KS ALL //SELECT DD * selection list PAY345 BILL578 /*
2. Sample FIND and CHANGE commands
* * Replace certain character strings * CAPS ON ; DEFAULT IS OFF BOUNDS 1 52 ; DEFAULT IS 1 72 f 'JJ''J' word c * 'JJ++J' word c X'c1c1c140' "1234" 2 11 ; 'AAA ' C " XXX " '<567>' 4 70 C 'E4E4E4E4E4'X VVVVV WORD ; 'UUUUU' -> 'VVVVV' C 'CLASS=N' 'CLASS=A' WORD /*
3. Sample PUNCH run
//PDSEDIT EXEC PGM=PDSEDIT,PARM='PUNCH' //SYSPRINT DD SYSOUT=* //SYSLIB DD DSN=PRISMCS.LOCAL.MVSJCL,DISP=SHR //SYSPUNCH DD DSN=&&NEWJCL,DISP=(,PASS) //SYSIN DD * BOUNDS 12 44 C PROD.ESDS MVS.PROD.ES ALL C PROD.KSDS MVS.PROD.KS ALL /* //UPDTE EXEC PGM=IEBUPDTE,PARM=NEW //SYSPRINT DD SYSOUT=* //SYSIN DD DSN=&&NEWJCL,DISP=(OLD,PASS) //SYSUT2 DD DSN=JANEDOE.NEW-JCL,DISP=OLD
4. Sample VSAM read-only FIND
//PDSEDIT EXEC PGM=PDSEDIT,PARM='TEST' //SYSPRINT DD SYSOUT=* //SYSLIB DD DSN=PROD.PAYROLL.ESDS,DISP=SHR //SYSIN DD * CAPS ON X 'Jones ' 24 ALL F 'Miami ' 47 ALL X /*
JCL
//PDSEDIT EXEC PGM=PDSEDIT,PARM='TEST' //SYSPRINT DD SYSOUT=* //SYSLIB DD DSN=PROD.PAYROLL.PDS,DISP=SHR //SYSIN DD * C ' CALL "ABC"' ' CALL "12345678"' C " CALL 'ABCDEFGH'" " CALL '123'" /*
SYSPRINT Output
GSF UTILITIES: PDS EDITOR R300 Wednesday 30 Jun 2004 (04.182) 11:43 11:43:46.96 PARAMETERS SPECIFIED FOR THIS RUN: 'TEST' DDNAME(SYSIN) IS ALLOCATED TO JES2,DSNAME=GILBERT.PDSEDITJ.JOB02874.D0000101.? C ' CALL "ABC"' ' CALL "12345678"' C " CALL 'ABCDEFGH'" " CALL '123'" 11:43:47.00 NUMBER OF RECORDS READ ON SYSIN: 2 DDNAME(SYSLIB) IS ALLOCATED TO DSNAME=PROD.PAYROLL.PDS,VOL=3390=PAYVOL MEMBER: MBR2 ==FND> CALL "ABC" CCCCCCCCCC DDDDDDDDDDDDDDDDDDDDD EEEEEEEEEE00001600 ==CHG> CALL "12345678" CCCCCCCCCC DDDDDDDDDDDDDDDDDDDDD EEEEEEEEEE00001600 ==FND> CALL 'ABCDEFGH' FFFFFF GGGGGGGGGGGGGGGGGGGGG HHHHHHHHHH00001700 ==CHG> CALL '123' FFFFFF GGGGGGGGGGGGGGGGGGGGG HHHHHHHHHH00001700 MEMBERS READ: 5 UPDATED: 1 IN ERROR: 0 RECORDS READ: 42 UPDATED: 2 IN ERROR: 0 11:43:47.05 ELAPSED TIME: 0.39 CPU TIME: 0.14 CPU RATE: 35.8% 11:43:47.05 CONNECT TIME: 0 I/O COUNT: 21 I/O RATE: 53.8 11:43:47.05 REGION ALLOCATED: 6208K,32768K REGION USED: 72K,72K
The SELECT and EXCLUDE data sets are optional and may contain member lists used to limit processing to specified members. Member lists may be specified in three different formats:
1.......9.......... //SELECT DD * ABCDEF XDSFHHR CDDDEEEE QQQQQQQQ /*
1.......9.......... //EXCLUDE DD DSN=PRISMCS.LOCAL.VASMMAC,DISP=SHR // DD DSN=PRISMCS.LOCAL.VASMCOP,DISP=SHR
1.......9.......... //SELECT DD * MEMBER1 member name DDN=ASMLIB ddname of a PDS MEMBER2 member name // DD DSN=PRISMCS.LOCAL.USERLIB(MYLIST),DISP=SHR //* //ASMLIB DD DSN=PRISMCS.LOCAL.VASMMAC,DISP=SHR // DD DSN=PRISMCS.LOCAL.VASMCOP,DISP=SHR
Notes:
Search key-words: ibm mvs job without tso os/390 z/os os390 zos pds pdse pds/e VSAM members source libraries edit scan search find change global replace in-place inplace text data record records editing scaning scanning searching finding changeing date replacing mass updates updating modify modifying ipoupdte cppupdte czx2pscr superc srchfor searchfor isrsupc asmfsupc editpds mbredit mbrfind pdsfind pdsupdat pdsupdte REXX ISPF/PDF Manual FSI PDS Manager PDSM18 5798-CXQ FDP chaine caractere chaines caracteres substitution mainframe mainframes