All of you Unix-haters, please look away  :-)

It turns out that the Unix shell has nice variable substitution
capabilities, and with our free Co:Z Batch utility (think "BPXBATCH without
the warts"), you can run it to tailor data with variable substitution.

Here's Victor's example reworked to do this:

//*********************************************************/
/* (1) Run an inline shell to tailor input using env vars
//*********************************************************/
//DELVSAM PROC VDSN='?'                 - VSAM DSN
//S1  EXEC PGM=COZBATCH,PARM='/VDSN=&VDSN'
//STDIN     DD *   Input to the Unix shell
cat << EOF
  DELETE ( $VDSN ) PURGE SCRATCH
EOF
//STDOUT   DD  UNIT=VIO,DISP=(,PASS),
//             SPACE=(TRK,1,1)),
//             DSN=&&WORK,
//             DCB=(BLKSIZE=80,LRECL=80,RECFM=FB)
//*********************************************************/
/* (2) RUN IDCAMS TO DELETE CLUSTER
//*********************************************************/
/DELDEFIN EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD  DISP=SHR,DSN=&&WORK
//    PEND

Another feature of COZBATCH is its ability to deal with the 100 character
PARM limit by stringing multiple steps together that set environment
variables.   See example #6 here:
http://dovetail.com/docs/cozbatch/examples.html

OK - Pardon me if I sound like the Sham-Wow guy, but what if you wanted to
delete all the clusters that matched a certain catalog search pattern
(IGGCSI00)?   The following combines COZBATCH with our "catsearch" shell
command (also included the free Co:Z Toolkit) and the Unix "awk" command:

//*********************************************************/
/* (1) Run an inline shell to generate IDCAMS stmnts
//*********************************************************/
//DELVSAM PROC PAT='HLQ.TEST.**.KSDS'
//S1  EXEC PGM=COZBATCH,PARM='/PAT=&PAT'
//STDIN     DD *   Input to the Unix shell
catsearch $PAT  |
awk '{  print "DELETE (" $1 ") PURGE SCRATCH"  }'
//STDOUT   DD  UNIT=VIO,DISP=(,PASS),
//             SPACE=(TRK,1,1)),
//             DSN=&&WORK,
//             DCB=(BLKSIZE=80,LRECL=80,RECFM=FB)
//*********************************************************/
/* (2) RUN IDCAMS TO DELETE CLUSTERS
//*********************************************************/
/DELDEFIN EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD  DISP=SHR,DSN=&&WORK
//    PEND

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

On Tue, Jul 7, 2009 at 12:53 PM, Victor Gil <[email protected]>wrote:

> Henrique,
>
> The below PROC is a sample of what you'd like to accomplish as it deletes a
> passed VSAM ds-name. The method is useful when SYSIN has only several
> VARIABLE cards. Also the PROC is easily convertable to plain JCL with the
> SET
> symbols:
>
> //DELVSAM PROC VDSN='?'                 - VSAM DSN
> //*********************************************************/
> /* (1) GENERATE TEMP INSTRUCTION WITH THE DSN:
> //*********************************************************/
> /GENTEMP  EXEC PGM=ASMA90,                                            X
> // PARM=('SYSPARM(   &VDSN -)')
> //SYSIN    DD  DSN=your.source.pds(PARMTODD),DISP=SHR
> //SYSUT1   DD  SPACE=(4096,(2,2)),UNIT=VIO
> //SYSLIB   DD  DSN=SYS1.MACLIB,DISP=SHR
> //SYSPRINT DD  DUMMY
> //SYSLIN   DD  UNIT=VIO,DISP=(,PASS),SPACE=(TRK,1,1)),
> //             DSN=&&amp;WORK,
> //             DCB=(BLKSIZE=80,LRECL=80,RECFM=FB)
> //*********************************************************/
> /* (2) RUN IDCAMS TO DELETE CLUSTER
> //*********************************************************/
> /DELDEFIN EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSIN    DD  DISP=SHR,DSN=skeleton(DELDEF1)   <- DELETE ( -
> //       DD  DISP=(SHR,PASS),DSN=&&amp;WORK    <- &VDSN
> //       DD  DISP=SHR,DSN=skeleton(DELDEF2) <- ) PURGE SCRATCH
> //    PEND
>
>
> where member PARMTODD is the following 2-line program placed in your source
> library
>
>          PUNCH '&SYSPARM'
>          END
>
> Hope this helps,
> -Victor-
>
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to