View previous topic :: View next topic
Author
Message
rgarg New User Joined: 15 Feb 2006Posts: 18
I want to delete some flat files through the JCL. But I only know the highest level qualifiers i.e E4MA.CP000000.E3TA.FFB.*. The file names may contain more that 5 qualifiers. I want to make JCL so that it will delete all the files having highest qualifier E4MA.CP000000.E3TA.FFB. I tried to do it by IDCAMS using wild card E4MA.CP000000.E3TA.FFB.** but I am getting error message E4MA.CP000000.E3TA' DOES NOT ADHERE TO RESTRICTIONS. Can you please help me with this? Thanks
Back to top
IQofaGerbil Active User Joined: 05 May 2006Posts: 183 Location: Scotland
you could try this
do a LISTCAT of the HLQ that you need and
write the output to a file
//S01 EXEC PGM=IDCAMS
//SYSPRINT DD DSN=TTT.IDCLIST,
// DISP=SHR
//SYSIN DD *
LISTCAT LEVEL(YOUR.LOWEST.LEVEL.DSN) -
NONVSAM -
NAME
//*
the data I created looks like this ;
IDCAMS SYSTEM SERVICES
LISTCAT LEVEL(YOUR.LOWEST.LEVEL.DSN) -
NONVSAM -
NAME
NONVSAM ------- YOUR.LOWEST.LEVEL.DSN.TTT.Z01
IN-CAT --- CATALOG.ICF.VLIB001
NONVSAM ------- YOUR.LOWEST.LEVEL.DSN.TTT.Z02
IN-CAT --- CATALOG.ICF.VLIB001
NONVSAM ------- YOUR.LOWEST.LEVEL.DSN.TTT.Z03
IN-CAT --- CATALOG.ICF.VLIB001
NONVSAM ------- YOUR.LOWEST.LEVEL.DSN.Z04.X01.Y01
IN-CAT --- CATALOG.ICF.VLIB001
NONVSAM ------- YOUR.LOWEST.LEVEL.DSN.TTT.Z05.X02
IN-CAT --- CATALOG.ICF.VLIB001
select the dataset names from the output (assuming they are all NONVSAM here, yours may be different so tailor the select command) and build a series of DELETE commands into another file
//S02 EXEC PGM=SORT
//SORTIN DD DSN=TTT.IDCLIST,DISP=SHR
//SORTOUT DD DSN=YYY.IDCLIST.DELETE,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(6,07,CH,EQ,C'NONVSAM')
OUTFIL OUTREC=(C' DELETE ',12:21,36),CONVERT
//*
The aim is to create a DELETE file now like this
DELETE YOUR.LOWEST.LEVEL.DSN.TTT.Z01
DELETE YOUR.LOWEST.LEVEL.DSN.TTT.Z02
DELETE YOUR.LOWEST.LEVEL.DSN.TTT.Z03
DELETE YOUR.LOWEST.LEVEL.DSN.Z04.X01.Y01
DELETE YOUR.LOWEST.LEVEL.DSN.TTT.Z05.X02
now execute IDCAMS deletes using file above
//S03 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=YYY.IDCLIST.DELETE,DISP=SHR
//*********************************
final check to confirm all deleted
//S04 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT LEVEL(YOUR.LOWEST.LEVEL.DSN) -
NONVSAM -
NAME
//*
hope this helps
Back to top
kgumraj Active User Joined: 01 May 2006Posts: 151 Location: Hyderabad
Use the ISPF command
in 3.4 with the qualifiers
issue SAVE list
open userid.list.datasets and edit it
use the JCL you are using earlier to delete entire dataset, with little modifications.
Back to top
rgarg New User Joined: 15 Feb 2006Posts: 18
Hi Gerbil,
When i tried the following step
//S02 EXEC PGM=SORT
//SORTIN DD DSN=TTT.IDCLIST,DISP=SHR
//SORTOUT DD DSN=YYY.IDCLIST.DELETE,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(6,07,CH,EQ,C'NONVSAM')
OUTFIL OUTREC=(C' DELETE ',12:21,36),CONVERT
//*
i am not getting anythin in the output file. I don't want the delete statement in the output file. My JCL is as follows
//SORTIN DD DSN=TRY.LISTCAT,
// DISP=SHR
//*
//SORTOUT DD DSN=TRY.OUTPUT,
// DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(2,1)),
// DCB=(DSORG=PS,LRECL=125,RECFM=FB,BLKSIZE=0),
// UNIT=SYSDA
//*
//SYSIN DD *
SORT FIELDS=COPY -
INCLUDE COND=(2,7,CH,EQ,C'NONVSAM') -
OUTREC FIELDS=(1:18,45),CONVERT
/*
//*
I am getting follwoing message in the spool
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VBA ; LRECL= 125; BLKSIZE= 27998
WER237I OUTREC RECORD LENGTH = 45
WER110I SORTOUT : RECFM=FB ; LRECL= 125; BLKSIZE= 27875
WER462I OUTPUT LRECL DIFFERS FROM SORTOUT LRECL
WER055I INSERT 0, DELETE 86
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B SORTIN: EXCP'S=1,UNIT=3390,DEV=532C,CHP=(B1B5B9BDBFC5C9CD,2),VOL=
WER416B SORTOUT: EXCP'S=0,UNIT=3390,DEV=F105,CHP=(B5B9BDB1C1C5C9,2),VOL=DH
WER416B TOTAL OF 1 EXCP'S ISSUED FOR COPYING
WER054I RCD IN 86, OUT 0
WER169I RELEASE 1.1D BATCH 0426 TPF LEVEL 3A
WER052I END SYNCSORT -
I am gettin MAXCC = 0 but output file is empty. Can you help me in that
Back to top
IQofaGerbil Active User Joined: 05 May 2006Posts: 183 Location: Scotland
What does the data in your infile look like?
the message
WER055I INSERT 0, DELETE 86
suggests that all 86 input records have been bypassed
also I was using DFSORT not Syncsort so the command syntax may be different.
Back to top
rgarg New User Joined: 15 Feb 2006Posts: 18
Hi Gerbil,
I got it, i was giving parameters wrong. Thank you so much for your help. Your JCL saved me a lot of time. I really appreciate your help. Thanks
Back to top
Please enable JavaScript!