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

delete records from a vsam


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1788
Location: Bloomington, IL

PostPosted: Thu Dec 23, 2010 4:15 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 23, 2010 4:16 pm
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
Reply with quote

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

Senior Member


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

PostPosted: Thu Dec 23, 2010 6:08 pm
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
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

Senior Member


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

PostPosted: Thu Dec 23, 2010 7:20 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Dec 23, 2010 10:45 pm
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

Superior Member


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

PostPosted: Thu Dec 30, 2010 8:46 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top