Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

regarding PARM in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: regarding PARM in JCL
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: 6968
Location: porcelain throne

PostPosted: Tue Sep 21, 2010 1:53 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm
No new posts Copy a particular column based on PAR... brindhamohan DFSORT/ICETOOL 5 Wed May 11, 2016 8:49 am
No new posts Use of Parm in SORT Ambili S DFSORT/ICETOOL 2 Mon May 09, 2016 9:16 pm
No new posts symbolic parm - allocate dsn krrp JCL & VSAM 11 Sat Oct 31, 2015 8:27 pm
No new posts EXEC SORT,REGION=0M,PARM=ELAP venugopal.mft DFSORT/ICETOOL 4 Wed May 20, 2015 12:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us