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

regarding PARM in JCL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 21, 2010 1:43 pm
Reply with quote

When data is passed to a cobol program using PARM in JCL , then the linkage section of the cobol pgm has the following.

01 PARM-DETAILS.
49 parm-length pic s9(4) comp.
49 parm-text pix x(3).

PROCEDURE DIVISION USING PARM-DETAILS.

My question is how does parm-length get the value because is JCL it's

step1 exec pgm=pgm1,parm='abc'



Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Sep 21, 2010 1:53 pm
Reply with quote

1. even though it is legal, I would not use lvl-49 for anything accept db2 varchar host variables.
it is for others reading the code, and has nothing to do with whether it works or not.

2. the acceptable characters following the 'parm=' are counted by jes and the count is placed in the S9(4) comp field preceding the actual parm text.

I make it a habit of defining my parms as follows:
Code:

LINKAGE SECTION.
01  PARM-AREA.
   05  PARM-LENGTH  PIC S9(4) COMP.
     88  EXPECTED-LENGTH  VALUE 3.
   05  PARM-INPUT     PIC X(100).
   05  EXPECTED-INPUT
   REDEFINES
        PARM-INPUT.
        10  PARM-TEXT PIC X(03).
        10  FILLER        PIC X(97).


PROCEDURE DIVISION USING PARM-AREA.

IF EXPECTED-LENGTH
THEN
   ...use PARM-TEXT
ELSE
   DISPLAY 'OTHER THAN EXPECTED PARM LENGTH ECEIVED: '
                 PARM-LENGTH
                 ' '
                 PARM-INPUT
   GOBACK
END-IF

Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 21, 2010 2:14 pm
Reply with quote

Thanks for the explanation . It was really helpful.
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 -> COBOL Programming

 


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 parm from JCL to Assembler, b... PL/I & Assembler 2
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
Search our Forums:

Back to Top