I was referring to my reply. The original question wasn't clear. -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Steve Comstock Sent: Wednesday, October 02, 2013 11:55 AM To: [email protected] Subject: Re: Determining number of Parameters passed to a COBOL program
On 10/2/2013 10:47 AM, Roberts, John J wrote: > This is of course for a COBOL BATCH MAIN program. Whar do you mean by 'This'? Are you refering to your original question or to the answer below? -Steve > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] > On Behalf Of Roberts, John J > Sent: Wednesday, October 02, 2013 11:43 AM > To: [email protected] > Subject: Re: Determining number of Parameters passed to a COBOL > program > > "Is there a way to determine how many parameters are being passed into a > COBOL program?" > > It all depends on the convention you employ for passing parameters. The most > common is to pass the PARM string as a comma delimited string. So in the > simplest form, the number of parameters is the number of commas plus one. > > In the example" //S1 EXEC PGM=P1,PARM='ABC,12345,X87,,55' "you have five > parameters, one of which is the null string. > > Typically you use the COBOL UNSTRING statement to parse the PARM string > looking for delimiters. > > The PARM string is typically declared like this: > > LINKAGE SECTION. > 01 LS-PARM. > 05 LS-PARM-LEN PIC S9(4) COMP. > 05 LS-PARM-TXT PIC X(100). > PROCEDURE DIVISION USING LS-PARM. > > > John > > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send > email to [email protected] with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send > email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
