IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Delete Records from VSAM file Thru SORT JCL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Wed Aug 01, 2012 4:24 pm
Reply with quote

Team,

I have requirement to delete 2 records from VSAM (KSDS) file. I know the key(first 10 bytes) of the records needs to be deleted from file and position of the File.

LRECL of VSAM file - 80
Key - > 1 to 10

i don't want to do this thru IDCAMS delete,define,copy from another file.
I want to do this thru SORT jcl.


Please share me your idea.

Regards
Jagadesh
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 01, 2012 4:34 pm
Reply with quote

Are you saying you want to delete in place from the KSDS?

Or you want a copy of the input excluding certain records?

Or what? Please be exact in the description of your requirement. Write it as though we have no idea of what you want, as we don't.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Wed Aug 01, 2012 4:48 pm
Reply with quote

Sorry Bill for incorrect data.

I have to Omit 2 records from the File and copy into same file.
Say i have VSAM FILEA having 100 records and i want to delete only 2 particular records from FILEA and update. So output will be same FILEA with 98 records.(i know the key of the 2 records also)

Regards
Jagadesh
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 01, 2012 4:56 pm
Reply with quote

It is not a good idea to use the same dataset name for SORTIN and SORTOUT in the same step. I think that leave DFSORT out of the equation.

It narrows you down to ICETOOL. Check the documentation. If you find nothing, don't worry, you'll have picked-up a general overview of what ICETOOL is capable of.

For your task I'd go for "something else" to take in keys and delete the keys. Do all the proper stuff with it, of course.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Wed Aug 01, 2012 4:58 pm
Reply with quote

Thanks Bill .

Sure then i will go by any other utility also.

Regards
Jagadesh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 01, 2012 7:26 pm
Reply with quote

Hello,

No matter how you do this or what utility you choose, you should not write over the input file . . .

A safe alternative (using sort) would be to copy the data to a work file getting rid of the 2 records you want to discard. If these are the records to be added, write them into a work file also.

You still want to delete/define the target file to clean it up.

Sort the concatenation of the majority of the file and the 2 "special" records and reload (sort will do this also).
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Wed Aug 01, 2012 10:04 pm
Reply with quote

Thanks for your Help Dick and Team

Regards
Jagadesh
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Aug 01, 2012 10:15 pm
Reply with quote

itjagadesh wrote:
i don't want to do this thru IDCAMS delete,define,copy from another file. I want to do this thru SORT jcl.


itjagadesh,

Unless the VSAM cluster is defined as REUSE , You cannot use the same cluster as input and output for DFSORT. And there is always an issue of using the same cluster for input and output in a copy operation.

IDCAMS is an excellent utility to delete records from a VSAM cluster and I am not sure as to why you don't want to use it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top