I'm new to REXX. I want to delete a set of workfiles created while
submitting a job. During testing I need to manually delete the datasets
and submit again.
It would be better, if I'm able to automize it using REXX.
Thanks in advance.
Tholkappian
-------------------------
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
Hope this helps,
Jim Horne
Lowe's Companies
> -----Original Message-----
> From: THOLKAPPIAN Chidambaram [SMTP:CTho...@COVANSYS.COM]
> Sent: Monday, April 16, 2001 1:28 PM
> To: TSO-...@VM.MARIST.EDU
> Subject: Re: deleting datasets in REXX
>
> Hi Steve,
>
> Thank you for your comments. It is a batch job and the jcl has the
> delete step at the end(executed if all the previous steps are succesful).
> I have intentionaly commented out that step to check the contents of
> those datasets.
>
> The datasets created may be of the format
> xxxx.dev.wrk.jobnamep
> xxxx.dev.wrk.jobnamep1 etc.,
> Since all jobs follow the same standard, It would be fine if I could
> delete it using a seperate rexx code after checking its contents.
>
> Thanks for your help
> Tholkappian
> -------------------------
>
>
>
> > -----Original Message-----
> > From: Steve Neeland [SMTP:Steve....@AMERICAWEST.COM]
> > Sent: Monday, April 16, 2001 10:35 PM
> > To: TSO-...@VM.MARIST.EDU
> > Subject: Re: deleting datasets in REXX
> >
> > If the 'job' that you are submitting is in batch, you should add a step
> to
> > the JCL at the beginning that includes all the datasets to be deleted.
> If
> > you're submitting the JCL from your Rexx program because there are many
> > values within the JCL that changed based on variables in the Rexx code,
> > you
> > could setup the JCL as a 'skeleton' JCL member, include the variables
> into
> > it that the Rexx code will establish, and submit it that way.
> >
> > If your running the job completely in foreground mode, you could
> allocate
> > those work files as 'temp' files so that the system should delete them
> > automatically.
> >
> > Steve
userid = SYSVAR(SYSUID)
/********* check if userid..REST.OF.DSNAME exists *****/
dataset = userid || ".REST.OF.DSNAME"
x = outtrap('line.')
"LISTC ent('"userid".REST.OF.DSNAME') volume"
i = 0
Do i = 1 to 11
name = substr(line.i,8,6)
if name = '.' then exit
if name = 'VOLSER' then Do
name2 = substr(line.i,8,44)
parse upper var name2 'VOLSER------------' volume ' D'
If volume = 'MIGRAT' then do
"HDELETE '"dataset"' NOWAIT"
say 'hdelete done on ' || userid || '.REST.OF.DSNAME'
end
else do
"DELETE '"dataset"' "
say 'delete done on ' || userid || '.REST.OF.DSNAME'
end
end
end
------------------------------------------------------------------
From: Daryl Wells
DB/DC Support
IBM Global Services
Tie Line 427-7487
Phone (813) 801-7487
Pager (800) 759-8888 pin 1366198 or
http://www.skytel.com/Paging/index.html
Isaac Yassin <yas...@BEZEQINT.NET>@VM.MARIST.EDU> on 04/16/2001 02:40:14
PM
Please respond to TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>
Sent by: TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>
To: TSO-...@VM.MARIST.EDU
cc:
Subject: Re: deleting datasets in REXX
Hi,
If file names are fixed (means no variable translation) you can add a
pre-step to your job like that:
//delete exec pgm=idcams
//sysprint dd sysout=*
//sysin dd *
delete 'your-file-name' scr
delete 'your-file-name' scr
set maxcc=0
//* next step
or you can do it in your rexx:
...
address tso
"delete 'your-file-name' scr"
...
Isaac Yassin
DBMS & IT Consultant
yas...@bezeqint.net
$volser = 'volser from LMDLIST command, variable=ZDLVOL'
$dataset_name = 'the dataset to delete'
SELECT
/*-----TAPE DATASET----------------*/
WHEN DATATYPE($VOLSER,N) = '1' THEN DO
SAY ' TAPE DATASET. USE "DELETE".'
$DELETE_COMMAND = 'DELETE'
$DELETE_ENDING = 'NSCR'
END /* WHEN TAPE... */
/*-----MIGRATED DATASET------------*/
WHEN $VOLSER = 'MIGRAT' THEN DO
SAY ' DATASET MIGRATED. USE "HDELETE".'
$DELETE_COMMAND = 'HDELETE'
$DELETE_ENDING = ' '
END /* WHEN MIGRATED... */
/*-----VSAM DATASET----------------*/
WHEN $VOLSER = '*VSAM*' THEN DO
SAY ' VSAM DATASET. USE "DELETE (XXX) CLUSTER".'
$DELETE_COMMAND = 'DELETE'
$DELETE_ENDING = 'CLUSTER'
END /* WHEN VSAM... */
/*-----GDG BASE--------------------*/
WHEN $VOLSER = '??????' THEN DO
SAY ' GDG BASE. USE "DELETE (XXX) GDG".'
$DELETE_COMMAND = 'DELETE'
$DELETE_ENDING = 'GDG'
END /* WHEN GDG BASE... */
/*-----NON-VSAM DATASET ON DASD-------------*/
OTHERWISE DO
SAY ' VOLSER='$VOLSER'. USE "DELETE".'
$DELETE_COMMAND = 'DELETE'
$DELETE_ENDING = ' '
END /* WHEN NOT MIGRATED NON-VSAM */
END /* SELECT */
/*--- delete command issued here ---*/
$DELETE_COMMAND "'"$DATASET_NAME"'" $DELETE_ENDING
IF RC = 0 THEN,
SAY $DATASET_NAME 'DELETED.'
ELSE,
SAY $DATASET_NAME 'NOT DELETED. DELETE MANUALLY.'
You can never have too many ways to complicate something simple.......
Steve
-----Original Message-----
From: Daryl Wells [mailto:dww...@US.IBM.COM]
Sent: Monday, April 16, 2001 11:29 AM
To: TSO-...@VM.MARIST.EDU
Subject: Re: deleting datasets in REXX
This way, you can "turn off" the DISP=(OLD,DELETE) or the IEFBR14/DELETE step
at the end and review your handy work without adding an extra manual step
when you want to rerun the job. MOD,DELETE has the interesting feature of
creating the dataset(s) if they don't exist (NO JCL ERROR) then deleting them
or just deleting them if they do exist.
Here is a sample (using the DSN you described in your post):
//JOBNAMEP JOB ......
//*
//* DELETE IF DSN EXISTS, CREATE AND DELETE IF IT DOESN'T
//*
//MODDEL EXEC PGM=IEFBR14
//DD1 DD DSN=MYDSN.DEV.WRK.JOBNAMEP,DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//*
//* RUN MY EXEC
//*
//BATCHTSO EXEC PGM=IKJEFT01,PARM='MYEXEC .....'
//SYSEXEC DD DSN=MYDSN.EXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//WRKFILE DD DSN=MYDSN.DEV.WRK.JOBNAMEP,DISP=(,CATLG)....
//* (or ALLOC internally in REXX EXEC)
//*
//* DELETE IF RC=0 (COMMENTED OUT FOR NOW)
//*
//*DELETE EXEC PGM=IEFBR14,COND=(0,NE)
//*DD1 DD DSN=MYDSN.DEV.WRK.JOBNAMEP,DISP=(OLD,DELETE)
Hope this helps,
Robert Zenuk
robz...@aol.com
>I'm new to REXX. I want to delete a set of workfiles created while
>submitting a job. During testing I need to manually delete the datasets
>and submit again.
Check the XDELETE exec in file 183 of the CBT tape. XDELETE uses the CSI
to retrieve data set names from the catalog (based on a generic name you
specify) and deletes (or HDELETEs) them.
If the same CBT file, you'll find CLEANUP, an assembler utility program
which has been designed to solve your problem.
Gilbert Saint-flour
Automated Migration Services
http://members.home.net/gsf/