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
 

 

Insert records into VSAM dataset

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

New User


Joined: 02 May 2008
Posts: 70
Location: chennai

PostPosted: Mon Feb 09, 2015 12:55 pm    Post subject: Insert records into VSAM dataset
Reply with quote

Hi,

I have a VSAM file and i need to insert some records inbetween. How do i do them using JCL
Code:

 Key                                       
 <===+>---10---+----2----+----3----+----4----+----5----
 IR0004  FUNCTIONS 01, 12, AND 13 REQUIRE FAC         
 IR0005  FUNCTIONS 02 AND 07 REQUIRE FAC AND TYPE     
 IR0006  FUNCTIONS 03, 05, 06 REQUIRE FAC AND ONE ONLY
 IR0007      AND INV         

Say, First 6 is the Key and i want to insert a line after the 'IR0004' and 'IR0006' how do i do this by using the JCL. how will be key reordered?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Mon Feb 09, 2015 5:20 pm    Post subject:
Reply with quote

First, be aware that VSAM has several types -- ESDS, KSDS, RRDS, LDS -- so just saying your data set is VSAM does NOT imply that it has a key.

Second, use IDCAMS to REPRO the new records. As long as the keys are unique and your data set is sorted into ascending key sequence the records will be inserted correctly.

Third, if your key does not have gaps, such as yours, then you will need to unload the VSAM data set, create a new key with the added records in the appropriate places, and then reload the VSAM data set (by using the DELETE / DEFINE / REPRO functions of IDCAMS).
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
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