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 a vsam

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

New User


Joined: 12 Jul 2008
Posts: 32
Location: sintra - portugal

PostPosted: Thu Dec 23, 2010 3:50 pm    Post subject: delete records from a vsam
Reply with quote

Hi, i need to delete 10 records of a vsam beginning in column 1 until 12, how can i do it with a job?
I already tried with IEHPROGM (with the scratch) and didn't work.
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1755
Location: Bloomington, IL

PostPosted: Thu Dec 23, 2010 4:15 pm    Post subject:
Reply with quote

What kind of "VSAM" -- ESDS, RRDS, KSDS, LS/MFT?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 23, 2010 4:16 pm    Post subject:
Reply with quote

IDCAMS :

REPRO SKIP(10)

Works only for the 1st 10 records.
Back to top
View user's profile Send private message
vasco ferreira

New User


Joined: 12 Jul 2008
Posts: 32
Location: sintra - portugal

PostPosted: Thu Dec 23, 2010 4:46 pm    Post subject: Reply to: delete records from a vsam
Reply with quote

It's aKSDS
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Thu Dec 23, 2010 6:08 pm    Post subject:
Reply with quote

What does column 1-12 have to do with it?
Back to top
View user's profile Send private message
vasco ferreira

New User


Joined: 12 Jul 2008
Posts: 32
Location: sintra - portugal

PostPosted: Thu Dec 23, 2010 7:17 pm    Post subject:
Reply with quote

Phrzby Phil wrote:
What does column 1-12 have to do with it?


That's the key
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Thu Dec 23, 2010 7:20 pm    Post subject:
Reply with quote

So it's the key.

Do you want to delete records with certain key values, or values of other fields, or just a certain number of records, or records at random, or what?

You say you want to delete 10 records. In that case, what does the key matter?

Clearly think about what you want, and then say so as clearly and unambiguously as you can.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Dec 23, 2010 10:45 pm    Post subject: Reply to: delete records from a vsam
Reply with quote

Review IDCAMS "FROMKEY" and "TOKEY" keywords, which can be used to copy a portion of an INFILE (your KSDS) to an OUTFILE.

You may have to use these multiple times, bypassing the records that you don't need.

Specify a temporary/catalogued QSAM flat-file for your OUTFILE and review the contents after you've completed the copy.

But, backup your KSDS file beforehand.

After review, if the FROM and TO key criteria work as you've expected, then just REPRO the flat-file contents into the KSDS file with REPLACE.

At a later point in time, you can delete the KSDS backup and the temporary/catalogued files.

Bill
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Dec 30, 2010 8:46 pm    Post subject: Re: delete records from a vsam
Reply with quote

vasco ferreira wrote:
Hi, i need to delete 10 records of a vsam beginning in column 1 until 12
I've two inferences from this:

1. Delete first 10-records from the VSAM-file -- If this is true - then mention about "column 1 until 12" is useless.

1. Delete first 12-bytes of first 10-records from the VSAM-file and copy the rest in output file as is -- may be repro the VSAM to QSAM, use SORT to do what you've asked for and repro back the sortout to VSAM.
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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