View previous topic :: View next topic
|
Author |
Message |
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Hi,Could u tell me how to pass more than one parameter using PARM To
COBOL and also the changes to be made in COBOL.
Thank u in Advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forums,
You will be ahead if you pass all of your information as one parm and redefine the parameter data in the linkage section into the multiple fields you need. You probably do not want to code for variable length and/or keyword parameters in your first parameter-using cobol program.
In the linkage section, define a level 01 like:.
Code: |
01 PARM-AREA.
05 PARM-LTH PIC 9(4) COMP.
05 PARM-DATA.
10 PARM-FLD-1 PIC ...
10 PARM-FLD-2 PIC ...
etc |
Name the fields as you need them with appropriate pictures (preferable PIC X(n). |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
To slightly elaborate, I prefer to require the EXEC card parms to be separated by commas, and so I define fields for the commas and check for them. If they aren't there, then most likely the parms have been mis-specified, so I kill the run:
Code: |
*=========================================
LINKAGE SECTION.
*=========================================
01 EXEC-PARM.
05 EP-LEN PIC S9(04) COMP.
05 EP-PARM1 PIC X(06).
05 EP-COMMA1 PIC X.
05 EP-PARM2 PIC X(04).
05 EP-COMMA2 PIC X.
05 EP-PARM3 PIC X(08).
05 EP-COMMA3 PIC X.
05 EP-PARM4 PIC X(08).
|
Code: |
*********************************************************
7400-PROCESS-EXEC-PARM-1.
*********************************************************
IF EP-LEN NOT = C-EXPECTED-LEN-EXEC-PARM
MOVE W-MSG-EP-INV-LEN TO P-MSG-CTL-ABEND-TXT
PERFORM 9910-EXEC-PARM-ERR
THRU 9910-EPE-EXIT
END-IF.
IF EP-COMMA1 NOT = ','
OR EP-COMMA2 NOT = ','
OR EP-COMMA3 NOT = ','
MOVE W-MSG-EP-INV-COMMAS TO P-MSG-CTL-ABEND-TXT
PERFORM 9910-EXEC-PARM-ERR
THRU 9910-EPE-EXIT
END-IF. |
Then proceed with checking the parm values. |
|
Back to top |
|
|
|