Rewrite VSAM in Cobol



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

Re: Rewrite VSAM in Cobol

Postby Robert Sample » Wed Nov 09, 2011 11:42 pm

IIRC, I've seen the 44 when someone is trying to write 120 byte records into a VSAM file that is defined with a maximum record length less than 120. Without seeing the IDCAMS LISTCAT output, however, there's no real way to determine how the actual file is set up.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Rewrite VSAM in Cobol

Postby BillyBoyo » Thu Nov 10, 2011 12:07 am

I am being naive Robert. I shouldn't assume that just because the record is defined as quite big in the Cobol program, someone has defined it reasonably for the VSAM. If it is a new program, raises the probability. Even for an existing program, if it has never had to write anything "that" big, then could still be an issue. LISTCAT please. Three times now.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Rewrite VSAM in Cobol

Postby sallyroselle » Thu Nov 10, 2011 1:25 am

I must not be explaining correctly. The VSAM file can be up to 1621 long. The record I was writing (just one of them. There are lots of different length records in the file) was 90 characters. When I went to rewrite it, I was doing a read first and using the length from the read to set how long the rewritten record should be. When I used the longer of the two records for my length, it worked and successfully changed the length of the rewritten record to the longer one.

Thanks for all the input!
sallyroselle
 
Posts: 12
Joined: Wed Nov 09, 2011 9:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rewrite VSAM in Cobol

Postby sallyroselle » Thu Nov 10, 2011 1:30 am

      ATTRIBUTES                                                               
        KEYLEN----------------15     AVGLRECL--------------72     BUFSPACE------
-----38912     CISIZE-------------18432                                         
        RKP--------------------0     MAXLRECL------------1651     EXCPEXIT------
----(NULL)     CI/CA-----------------45                                         
        SHROPTNS(2,3)      SPEED     UNIQUE           NOERASE     INDEXED       
NOWRITECHK     NOIMBED       NOREPLICAT                                         
        UNORDERED          REUSE     NONSPANNED                                 
      STATISTICS  (* - VALUE MAY BE INCORRECT)                                 
        REC-TOTAL-------------92*    SPLITS-CI--------------7*    EXCPS---------
-----29872*                                                                     
        REC-DELETED----------390*    SPLITS-CA--------------0*    EXTENTS-------
---------1                                                                     
        REC-INSERTED---------451*    FREESPACE-%CI----------5     SYSTEM-TIMESTA
MP:                                                                             
        REC-UPDATED---------1453*    FREESPACE-%CA---------10          X'C8A62E5
7A8630C2C'                                                                     
        REC-RETRIEVED------34784*    FREESPC---------12275712*                 
sallyroselle
 
Posts: 12
Joined: Wed Nov 09, 2011 9:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rewrite VSAM in Cobol

Postby sallyroselle » Thu Nov 10, 2011 1:37 am

I just found that it was trying to use more than 1621 to rewrite the record. This was causing the issue.
sallyroselle
 
Posts: 12
Joined: Wed Nov 09, 2011 9:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rewrite VSAM in Cobol

Postby Robert Sample » Thu Nov 10, 2011 1:45 am

That would definitely cause a boundary violation! Glad you found it, and thanks for letting us know.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Rewrite VSAM in Cobol

Postby BillyBoyo » Thu Nov 10, 2011 4:58 am

Yes, good to know you got it.

Looking at your LISTCAT snippet, your CISIZE is big for random processing. Is the file normally processed serially? Looks like you have the default freespace percentages, was that intentional?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Rewrite VSAM in Cobol

Postby BillW » Sat Nov 12, 2011 4:54 am

I know that you can change the length of a KSDS record. In the definition of the file you can give it the different lengths. Also, Cobol needs to know the record is varying. I have rewritten records with varying lengths which was handled fine, sadly I don't remember how I did it 12 years ago. Also, cobol gets the record length from vsam when the record is initially read and you set the record length for output in a similar fashion. Sorry can't remember this, I don't have samples anymore of how I did it, but don't let anyone tell you it can't be done. BillyBoyo seems to be on the right track.
BillW
 
Posts: 20
Joined: Thu Nov 10, 2011 8:21 am
Has thanked: 0 time
Been thanked: 3 times

Previous

Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post