Query for PARM Length

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
ARakesh
Member
Posts: 5
Joined: Mon May 31, 2010 4:31 pm

Query for PARM Length

Post by ARakesh » Tue Jun 01, 2010 3:05 pm

hi,
Suppose i have following code in JCL where i am passing Employee name to the program and i have coded Linkage section in my cobol program to accept the PARM value as below.

JCL:
//STEP1 EXEC PGM=TESTPROG,PARM='RAKESH'

COBOL:
LINKAGE SECTION.
01 WS-EMP-REC.
02 WS-EMP-LEN PIC S9(04) COMP.
02 WS-EMP-NAME PIC X(10).

My query is why we code PIC for length as 'S9(04)' when we know that it will never be negative ? Every where i have seen as 'S9(04)' only.
Thanks & Regards,
Rakesh

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Jun 01, 2010 11:35 pm

IBM does not use unsigned binary very much.

anyway, that is the syntax, whether it makes sense to you or not.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Thu Jun 03, 2010 8:44 pm

Rakesh,

field WS-EMP-LEN contain length of data being passed from jcl.
Natarajan
Chennai

ARakesh
Member
Posts: 5
Joined: Mon May 31, 2010 4:31 pm

Post by ARakesh » Fri Jun 04, 2010 4:29 pm

Hi Natarajan,

Thts rite that WS-EMP-LEN contains the length of the data passed from JCL but i was thinking that why there is a need for signed picture clause ? when we know that length field will be positive always.

May be that is IBM standard which is followed always. as said by 'dbzTHEdinosauer'.
Thanks & Regards,
Rakesh

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others