Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Want to delete some flat files through the JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rgarg

New User


Joined: 15 Feb 2006
Posts: 18

PostPosted: Wed Sep 13, 2006 10:40 am    Post subject: Want to delete some flat files through the JCL
Reply with quote

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
View user's profile Send private message

IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Wed Sep 13, 2006 3:15 pm    Post subject: Re: Delete JCL
Reply with quote

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
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Wed Sep 13, 2006 8:35 pm    Post subject: Re: Want to delete some flat files through the JCL
Reply with quote

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
View user's profile Send private message
rgarg

New User


Joined: 15 Feb 2006
Posts: 18

PostPosted: Thu Sep 14, 2006 10:04 pm    Post subject: Re: Want to delete some flat files through the JCL
Reply with quote

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
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Fri Sep 15, 2006 12:39 am    Post subject: Re: Want to delete some flat files through the JCL
Reply with quote

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
View user's profile Send private message
rgarg

New User


Joined: 15 Feb 2006
Posts: 18

PostPosted: Fri Sep 15, 2006 9:53 am    Post subject: Re: Want to delete some flat files through the JCL
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us