View previous topic :: View next topic
|
Author |
Message |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi,
I'm trying to call a PL/I program from COBOL Program, but encountering an unusual Return Code (2720), though output is coming fine. Can you please suggest what could be the possible reason and how can I resolve it.
Here is my code:
Calling Program (COBOL)
Code: |
WORKING-STORAGE SECTION.
*
01 POLICY-PTR USAGE IS POINTER.
* THIS SEGMENT IS USED BY TSUXXX WHEN CONVERTING A
* POLICY NO FROM FILE FORMAT TO DISPLAY FORMAT
01 POLICY-FORMAT.
03 WS-POLICY1 PIC X(11) VALUE SPACES.
03 WS-POLICY2 PIC X(13) VALUE SPACES.
03 WS-STATUS PIC X(02) VALUE SPACES.
*
PROCEDURE DIVISION.
*
* MAINLINE
*
*======================
000-MAINLINE SECTION.
*======================
*
MOVE '001234567 8' TO WS-POLICY1 OF POLICY-FORMAT
*
SET POLICY-PTR TO ADDRESS OF POLICY-FORMAT
*
CALL 'TSUXXX' USING POLICY-PTR
*
IF WS-STATUS OF POLICY-FORMAT NOT EQUAL SPACES
DISPLAY 'BAD STATUS FROM TSUXXX:'
WS-STATUS OF POLICY-FORMAT
ELSE
DISPLAY 'FORMATTED POLICY NO IS:'
WS-POLICY2 OF POLICY-FORMAT
END-IF.
*
000-EXIT.
STOP RUN.
*
* END OF MAINLINE
*
|
Called Program (PL/I)
Code: |
/* TSUXXX - FORMAT POLICY NUMBER. */
TSUXXX:
PROC (POLICY_PTR) OPTIONS (REENTRANT) REORDER ;
DCL 1 POLICY_FORMAT BASED (POLICY_PTR),
7 WS_POLICY_1 CHAR(11)
,7 WS_POLICY_2 CHAR(13)
,7 WS_TATUS CHAR(02) ;
|
Edited to add JES Messages:
Code: |
JESYSMSG:
IEF142I AAAAA001 STEP01 - STEP WAS EXECUTED - COND CODE 2720
SYSOUT:
FORMATTED POLICY NO IS:1234,567/8
|
~Neeraj |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Code: |
01 RETURN-CODE GLOBAL PICTURE S9(4) USAGE BINARY VALUE ZERO.
STOP RUN.
|
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Thanks Peter..I have changed it as below and it's working fine now:
Code: |
IF WS-STATUS OF POLICY-FORMAT NOT EQUAL SPACES
DISPLAY 'BAD STATUS FROM TSUXXX:'
WS-STATUS OF POLICY-FORMAT
MOVE 100 TO RETURN-CODE
ELSE
DISPLAY 'FORMATTED POLICY NO IS:'
WS-POLICY2 OF POLICY-FORMAT
MOVE 00 TO RETURN-CODE
END-IF. |
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
You are welcome. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
RETURN-CODE is a "Cobol special register". After a CALL the contents of Register 15 will be stored in it, and when the current program returns to where it came from, the RETURN-CODE will become the final value of Register 15 when it arrives at z/OS.
So, since you do nothing to RETURN-CODE in your Cobol program, I guess the value is coming from the PL/I.
Have you looked here?
What you have now done is ignore the value coming back from the PL/I program, which may be indicating something you need to know about.
When you display "bad" messages, it is really useful to have some type of "key" or reference to be able to identify the input with the problem. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Peter,
RETURN-CODE is a Cobol "Special Register". It is defined by the Compiler, not the programmer. |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi Bill,
I have changed the PL/I Module as below and it's working fine with the previous COBOL Code.
Code: |
/* TSUXXX - FORMAT POLICY NUMBER. */
TSUXXX:
PROC (POLICY_PTR) OPTIONS (REENTRANT,COBOL) REORDER ;
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Thanks for letting us know. |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Thanks Bill and Peter..for helping me out :-) |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
FWIW, the PL/I equivalent to RETURN-CODE is PLIRETC. |
|
Back to top |
|
|
|