IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Passing of parameters through Parm.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Wed Jun 20, 2007 7:44 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 20, 2007 8:04 am
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Wed Jun 20, 2007 6:07 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Need to specify PARM='POSIX(ON) Java & MQSeries 4
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Passing SYSPRINT to Invoked Program PL/I & Assembler 9
Search our Forums:

Back to Top