hi,
Please help me if anyone know the code.
I have an easytrive which is calling a COBOL program using CALL statement.
I want to pass a value to the COBOL Program which is like PARM.
below is the code which i tried to pass, but it is not working
WS-PARM1 W 4 A VALUE 'XXX '
CALL PGM1 USING (WS-PARM1)
PGM1 is a COBOL program
Dynamically passing value to calling program in Easytrieve
Moderators: DikDude, Moderator Group
-
- Member
- Posts: 13
- Joined: Mon Feb 17, 2014 11:35 am
- Location: Hyderabad
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 13
- Joined: Mon Feb 17, 2014 11:35 am
- Location: Hyderabad
Hi Collins,
here is the code in cobol program which i am using
working storage i defined a field
01 WS-PARM-REGION PIC X(04).
88 88-PARM-XXX VALUE 'XXX '.
88 88-PARM-YYYY VALUE 'YYYY'.
Linkage Section:
LINKAGE SECTION.
01 PARM.
05 LNGTH PIC S9(04) COMP.
05 PARM-REGION PIC X(04).
PROCEDURE DIVISION USING PARM.
MOVE PARM-REGION TO WS-PARM-REGION
-------
-------
-------
IF 88-PARM-XXX
PERFORM PROCESS-XXXX
ELSE
PERFORM PROCESS-YYYY
END-IF
-----
-----
STOP RUN.
---------------------------------------------
after complettion of the job with the easytrive code i gave, PROCESS-YYYY para is executing even i pass 'XXX '.
here is the code in cobol program which i am using
working storage i defined a field
01 WS-PARM-REGION PIC X(04).
88 88-PARM-XXX VALUE 'XXX '.
88 88-PARM-YYYY VALUE 'YYYY'.
Linkage Section:
LINKAGE SECTION.
01 PARM.
05 LNGTH PIC S9(04) COMP.
05 PARM-REGION PIC X(04).
PROCEDURE DIVISION USING PARM.
MOVE PARM-REGION TO WS-PARM-REGION
-------
-------
-------
IF 88-PARM-XXX
PERFORM PROCESS-XXXX
ELSE
PERFORM PROCESS-YYYY
END-IF
-----
-----
STOP RUN.
---------------------------------------------
after complettion of the job with the easytrive code i gave, PROCESS-YYYY para is executing even i pass 'XXX '.
Pawan K
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Whoops. Seemed to have not posted an asnwer for this one...
You have defned your LINKAGE SECTION field incorrectly. That definition, which iincludes a length as the first part of a field, is fine from a program initiated by EXEC PGM=...,PARM="...." in your JCL, but Easytrieve CALLs use exactly the same conventions as COBOL CALLs, so there is no length in a field. You are accidentally ignoring the first two bytes of your field. Just define it as PIC X(4) without the COMP part at all.
You have defned your LINKAGE SECTION field incorrectly. That definition, which iincludes a length as the first part of a field, is fine from a program initiated by EXEC PGM=...,PARM="...." in your JCL, but Easytrieve CALLs use exactly the same conventions as COBOL CALLs, so there is no length in a field. You are accidentally ignoring the first two bytes of your field. Just define it as PIC X(4) without the COMP part at all.
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page