PDSEDIT - The PDS and PDSE Editor

                   

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:

  • The syntax of PDSEDIT commands is similar to the syntax of some ISPF/PDF commands, such as FIND. CHANGE, EXCLUDE and BOUNDS
  • String replacement is performed in a way which is similar to that effected by the CHANGE command of ISPF/PDF. In particular, when the length of the old character string is different from the length of the new string, PDSEDIT compresses or expands the spaces between the end of the new string and the right boundary (or the end of the line), as shown in the example below.

PDSEDIT is a batch utility program controlled via the PARM field of the EXEC JCL statement and SYSIN control statements.

           

JCL PARM

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:

  1. PARM=(TEST,PROG2) limits processing to member PROG2
  2. PARM=(UPDATE,PROG*) limits processing to members whose names start with PROG
  3. PARM=(PUNCH,DEF123:KLM567) limits processing to members which fall within the range DEF123 through KLM567

Member selection is available via the SELECT and EXCLUDE data sets as well.

JCL Requirements

PDSEDIT requires several DD statements:

SYSIN Control 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.

Examples

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
	/* 

Sample SYSPRINT Output

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  

Member Selection using the SELECT and EXCLUDE data sets

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. as a sequential data set, containing member names in pos 1 through 8 of each record. Several sequential data sets or PDS members may be concatenated to form the list. The sequential data set can contain variable-length records, including short ones.
    	1.......9..........
    	//SELECT  DD  *
    	ABCDEF
    	XDSFHHR
    	CDDDEEEE
    	QQQQQQQQ
    	/* 
  2. as a partitioned data set; MBRLIST reads the PDS directory and internally builds a member list. Concatenation is supported.
    	1.......9..........
    	//EXCLUDE DD  DSN=PRISMCS.LOCAL.VASMMAC,DISP=SHR
    	//	  DD  DSN=PRISMCS.LOCAL.VASMCOP,DISP=SHR 
  3. as a combination of #1 and #2 above. The sequential data set contains member names and indirect specification of PDS directories via the DDN key-word. For example:
    	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