Page 2 of 2

Re: Rewrite VSAM in Cobol

PostPosted: Wed Nov 09, 2011 11:42 pm
by Robert Sample
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.

Re: Rewrite VSAM in Cobol

PostPosted: Thu Nov 10, 2011 12:07 am
by BillyBoyo
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.

Re: Rewrite VSAM in Cobol

PostPosted: Thu Nov 10, 2011 1:25 am
by sallyroselle
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!

Re: Rewrite VSAM in Cobol

PostPosted: Thu Nov 10, 2011 1:30 am
by sallyroselle
      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*                 

Re: Rewrite VSAM in Cobol

PostPosted: Thu Nov 10, 2011 1:37 am
by sallyroselle
I just found that it was trying to use more than 1621 to rewrite the record. This was causing the issue.

Re: Rewrite VSAM in Cobol

PostPosted: Thu Nov 10, 2011 1:45 am
by Robert Sample
That would definitely cause a boundary violation! Glad you found it, and thanks for letting us know.

Re: Rewrite VSAM in Cobol

PostPosted: Thu Nov 10, 2011 4:58 am
by BillyBoyo
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?

Re: Rewrite VSAM in Cobol

PostPosted: Sat Nov 12, 2011 4:54 am
by BillW
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.