Inserting new record into VSAM Backup File



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Inserting new record into VSAM Backup File

Postby Sivapradeep » Fri Apr 27, 2012 12:32 pm

Hi,

I took backup of VSAM KSDS file into PS file using IDCAMS EXPORT utility. Now, i edited already existing record and saved this PS file and used IDCAMS IMPORT utility to restore the original KSDS file. the edited record has restored without any error.
but when i tried to insert a new record into the backup PS file and during restoration using IDCAMS IMPORT i'm getting an error.(snapshot shown below).
 ACTION ERROR ON E183904.JUN11LC.KSDS                       
** VSAM I/O RETURN CODE IS 108 - RPLFDBWD = X'8408006C'     
 IMPORT OF DATA SET FAILED AFTER DEFINE - DELETE ATTEMPTED   


what changes i should do to restore this backup ps file with new inserted record?
Sivapradeep
 
Posts: 35
Joined: Mon Mar 26, 2012 2:09 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Inserting new record into VSAM Backup File

Postby BillyBoyo » Fri Apr 27, 2012 1:02 pm

Why would you ever want to change a back-up? At that point, it stops being a back-up and you have no back-up.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Inserting new record into VSAM Backup File

Postby Sivapradeep » Fri Apr 27, 2012 2:32 pm

Ya I knew this and u r rite. But I've to create new records in the ps file and build vsam based on this new records. Can you give the procedure for implementing this idea ?
Sivapradeep
 
Posts: 35
Joined: Mon Mar 26, 2012 2:09 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Inserting new record into VSAM Backup File

Postby BillyBoyo » Fri Apr 27, 2012 3:09 pm

Make sure you have an "untouched" backup of the VSAM file.

Just copy your VSAM using a program (SORT, IDCAMS with REPRO, for instance) to an actual PS. Edit. Do the reverse direction.

You might want to delete/define before going in the other direction.

If you go in an edit a structured back-up file, you won't be able to use it for anything.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Inserting new record into VSAM Backup File

Postby Robert Sample » Fri Apr 27, 2012 6:21 pm

EXPORT saves the index informatino as well as the data information for the VSAM KSDS -- this is why you don't have to use DEFINE before an IMPORT. Changing an existing record won't impact the index information (unless, of course, you change the record length in which all bets are off). However, adding (or deleting) a record will change the index information and hence render the exproted file unusable as the index cannot be used any longer to rebuild the KSDS file.

If you want to modify (by adding to or deleling records from) the "backup" (and I use that word very cautiously since if you making changes to the output file and not the KSDS file, then you no longer have a "backup" file at all) then you MUST use REPRO to build a sequential file and then use DELETE / DEFINE to build the KSDS definnition anew before loading the data back again. Unless, of course, you spend the time to figure out the hexadecimal values that you must change to incorporate the changed index information in the exported file -- and don't forget that VSAM compresses the index keys so the process requires you to ALSO know how to rebuild compressed keys. And depending upon the specific changes, you might have to add a new level of index to the exported file, and so forth.

In other words, attempting to change an exported file the way you are doing is an EXTREMELY BAD idea for many, many, many reasons.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post