I have a VSAM file and i need to insert some records inbetween. How do i do them using JCL
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?
Joined: 06 Jun 2008 Posts: 8151 Location: East Dubuque, Illinois, USA
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).