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
 

 

Delete Records from VSAM file Thru SORT JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Delete Records from VSAM file Thru SORT JCL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Aug 01, 2012 4:34 pm    Post subject: Reply to: Delete Records from VSAM file Thru SORT JCL
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    Post subject: Reply to: Delete Records from VSAM file Thru SORT JCL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Aug 01, 2012 4:56 pm    Post subject: Reply to: Delete Records from VSAM file Thru SORT JCL
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    Post subject: Reply to: Delete Records from VSAM file Thru SORT JCL
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

Site Director


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

PostPosted: Wed Aug 01, 2012 7:26 pm    Post subject:
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    Post subject: Reply to: Delete Records from VSAM file Thru SORT JCL
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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