On May 25, 2005, at 1:21 AM, Paul Gilmartin wrote:
In a recent note, Norbert Friemel said:

Date:         Tue, 24 May 2005 17:00:02 -0500

Yes. From the dusty "IBM OS Full American National Standard COBOL,
GC28-6396-5, Revised 12/1/75 by TNL GN26-0808, p. 234":
...
At execution time, the USING option may be used to pass parameters from the EXEC job control statement to a main COBOL program. In this case, a USING
option on the Procedure Division header of a main program may contain
identifier-1 as its only operand. Information from the PARM field of the EXEC statement is then available in the Linkage Section at the location specified as identifier-1. The first two bytes of identifier-1 contain a count of the number of bytes of information in the PARM field; the two bytes are set to zero if the PARM field was omitted. This two-byte field is binary and should be defined with PIC S9(4) COMP. Immediately following these two bytes is the information in the PARM field. The maximum length of the field
to be passed is 100 bytes.
...
Is this still in effect?

Does it specify, or does experiment show what happens if the program
is invoked (by LINK, ATTACH, CALL, XCTL, or address ATTCHMVS) with
a PARM>100 characters?  Plausible actions:

o Runtime initialization terminates execution with an error indication.
  This is as benign as JCL error.

o The PARM overlays adjacent data.

o Runtime initialization truncates the PARM.  (I consider this
  an integrity violation.)

o The identifier-1 is opaquely based on the content of GR1 at
  program initiation.  It is then the programmer's responsibility
  to do his own truncation or overlaying.

Has anyone done the experiment?

There is nothing to experiment -- the 100 byte limit referred to is from the JCL parm only. For that version of COBOL the limit on an individual data item should have been 32K -- but those were the days of BLL cells and managing your own based addressing -- parms could have had some sort of practical limit of 4K.

However, if you passed MORE data into said program you would receive no error, the COBOL program would only map the first 100 bytes or whatever was defined. If you use the length to attempt a move that exceeded the size of the item current versions of COBOL will abend with a U4038 and a message that you attempted to reference an area outside of a defined data item.

No truncation will occur.

[EMAIL PROTECTED]

Web Servers Do It With Cookies

----------------------------------------------------------------------
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

Reply via email to