>>> On 1/6/2010 at 3:48 PM, in message <053f2631ec9c584883847c8b4970a22805bcc...@josqems1.jsq.bsg.ad.adp.com>, "Farley, Peter x23353" <[email protected]> wrote: >> -----Original Message----- >> From: IBM Mainframe Discussion List [mailto:[email protected]] On >> Behalf Of Frank Swarbrick >> Sent: Wednesday, January 06, 2010 5:24 PM >> To: [email protected] >> Subject: Re: Cobol rewrite variable length record >> >> >>> On 1/6/2010 at 1:47 PM, in message >> <[email protected]>, Steve >> Comstock <[email protected]> wrote: >> > Frank Swarbrick wrote: >> >>>>> On 1/6/2010 at 12:52 PM, in message >> <[email protected]>, >> >> Steve Comstock <[email protected]> wrote: >> >>>> My question is, why does it work when the file is VSAM, even > without >> the >> >>> RECORD IS VARYING? >> >>> Question: are you running your tests under VSE or z/OS? >> >> >> >> I tested sequential on both, but only tested VSAM on VSE. I guess > I >> just >> > assumed that VSAM would behave the same on z/OS. >> >> >> >> Frank >> >> >> > >> > I would guess not. My notes from "VSAM for COBOL Programmers" say >> > ESDS supports update in place but no change in record length. >> > >> > But I guess the only real proof is in the doing. >> >> It's not changing the record length. That is what is so odd. It > reads a >> 17 byte VSAM record and then does the rewrite that seems to imply the > 69 >> byte record, but it in fact rewrites just the 17. Which is what is >> wanted, but I can't explain why it is working. >> >> But I have spent enough time on this when I already have my solution > that >> will work both for VSAM and regular SAM, on both z/OS and VSE. I was > just >> wondering why something that apparently shouldn't work was working. >> >> Thanks! > > COBOL (RE)WRITE is *supposed* use the length of the (fixed) 01-level > record name to control the length of the record that is written. VSE > COBOL for the VSAM case *may* be saving the length from the read and > specifying it on the rewrite. In any case, as I replied earlier, there > is no need to use RECORD IS VARYING, just use the internal record > indicators in your data to select which 01-level record name to use in > the rewrite.
Yeah, that is one way that I considered. I like the RECORD IS VARYING because if someone writes a new record type to the file I don't have to make any changes to this program. It will just rewrite with the same length it just read. Thanks! Frank -- Frank Swarbrick Applications Architect - Mainframe Applications Development FirstBank Data Corporation - Lakewood, CO USA P: 303-235-1403 The information contained in this electronic communication and any document attached hereto or transmitted herewith is confidential and intended for the exclusive use of the individual or entity named above. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any examination, use, dissemination, distribution or copying of this communication or any part thereof is strictly prohibited. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy this communication. Thank you. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

