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
 

 

display variable in call prog when exec the called prog
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 6:35 pm    Post subject: display variable in call prog when exec the called prog
Reply with quote

hi all,
i am presently testing cobol code
example the programs are pm5054 and pm5020

the coobat program pm5054 calls the program pm5020

i want a variable lets say ERROR-STATUS of of 129 bytes which is present in pm5020 program to be displayed in sysout when i run the program pm5054 .

thanks in advance
Bahugun
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 11, 2011 6:38 pm    Post subject:
Reply with quote

Well that's just fantastic and now we all know what you want.

What have you done so far yourself, and what errors do you need help with.

I'm sure a few of the COBOL fraternity will have some more questions for you.
Back to top
View user's profile Send private message
Parvinder Singh

New User


Joined: 06 Sep 2011
Posts: 6
Location: india

PostPosted: Fri Nov 11, 2011 6:59 pm    Post subject:
Reply with quote

Give Display for Error-Status in pm5020, compile it . recompile pm5054 then run your job. You will get Error-Status contents in sysout. Hope this helps !!!
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 7:02 pm    Post subject: not working
Reply with quote

i have already tried that but it is not gettign deisplayed.thats why i am asking help .
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Fri Nov 11, 2011 7:10 pm    Post subject:
Reply with quote

You might want to check your run JCL. Your program run step should have something like -

//SYSOUT DD SYSOUT=*
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 7:12 pm    Post subject: yes it is there
Reply with quote

//SYSOUT DD SYSOUT=*

it is present in the step where i am calling the pm5054 program in jcl.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 11, 2011 7:16 pm    Post subject: Reply to: display variable in call prog when exec the calle
Reply with quote

Can you show the code and the data definitions in 5020, Linkage Section, any relevant Workng Storage, Procedure Division using, please.
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 7:22 pm    Post subject: Procedure Division
Reply with quote

*PROCEDURE DIVISION USING WS-INPUT-CITY, WS-OTHER-PARMS.
LINKAGE SECTION.
01 ZZ-USINGPARM1 PIC X(3).
01 ZZ-USINGPARM2 PIC X(341).
PROCEDURE DIVISION USING ZZ-USINGPARM1 , ZZ-USINGPARM2 .
GO TO ZZ-BYPASS-DMSII-SECTION.
ZZ-DMSII-SECTION SECTION.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 11, 2011 7:25 pm    Post subject: Reply to: display variable in call prog when exec the calle
Reply with quote

Where in ZZUSINGPARM2 is the thing you want to display? Where is your attempt to display it, the DISPLAY statement and a couple of lines around it, please.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 11, 2011 7:32 pm    Post subject:
Reply with quote

Parvinder Singh wrote:
Give Display for Error-Status in pm5020, compile it . recompile pm5054 then run your job. You will get Error-Status contents in sysout. Hope this helps !!!


Curious as to why you'd feel the need to recompile 5054 if not suggesting any changes there. I can't see it as anything but a waste of time?
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 7:35 pm    Post subject: reply
Reply with quote

the varable i want to display is
PMS-ERROR-STATUS (129)

* THIS WORKING STORAGE
01 PMS-ERROR-STATUS-AREA.
02 PMS-ERROR-STATUS-INDICATORS.
03 PMS-ERROR-STATUS PIC X(129).
03 PMS-ERROR-STATUS-R REDEFINES ESI-ERROR-STATUS.
05 ESI-GROUP PIC 9(01).
ETC...

like that it is redefineed many times in the program as per the requirements

i just searched where the some data is moved in the program .below that i specified the below display step
example
MOVE PMS-ERROR-STATUS TO WS-PMS-ERRORS
DISPLAY " PMS-ERROR-STATUS:" PMS-ERROR-STATUS

regards
Bahugun
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 7:39 pm    Post subject: error
Reply with quote

it is not ESI it is PMS please do not get confused


* THIS WORKING STORAGE
01 PMS-ERROR-STATUS-AREA.
02 PMS-ERROR-STATUS-INDICATORS.
03 PMS-ERROR-STATUS PIC X(129).
03 PMS-ERROR-STATUS-R REDEFINES PMS-ERROR-STATUS.
05 PMS-GROUP PIC 9(01).
ETC...

example
MOVE PMS-ERROR-STATUS TO WS-PMS-ERRORS
DISPLAY " PMS-ERROR-STATUS:" PMS-ERROR-STATUS
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 11, 2011 8:12 pm    Post subject: Reply to: display variable in call prog when exec the calle
Reply with quote

I think we'd best start again, as I'm getting more confused rather than less.

Program 5054

Calls 5020

5020 has the 129-byte error status in Working Storage

You want to display that error status.

Am I right so far?

When you run 5054 (EXEC PGM=blahblah5054) you want to display the error-status that is in 5020 to be displayed at a point which is relevant.

I thought you wanted either to display data from 5054, or do the display in 5054, but it seems now that all mention of 5054 might be a red-herring.

You have a DISPLAY in 5020 which is not being executed.

You have the SYSOUT DD, so the most likely cause is a logic error in5020.

All we have seen of the code in 5020 is a GO TO statement.

We need to see more of your code. You have sections, so let's see the whole SECTION where the display is, and any/all code which deals with entering that section.
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Fri Nov 11, 2011 8:19 pm    Post subject: reply
Reply with quote

i am running the jcl for PM5054.
the cobbat program of PM5054 calls the program PM5020.
the variable PMS-ERROR-STATUS is present in PM5020.

i want the PMS-ERROR-STATUS to be displayed in SYSOUT of the jcl PM5054(as PM5054 is calling PM5020 program internally)

the code is very big to be shared

as per my understandng
where ever there is a move statement in the code of PM5020 i have given display statement below it.

i have recomplied the PM5020 program after that

now when i run the jcl for the program PM5054 i need the varable value be displayed in the SYSOUT of this JCL

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

Global Moderator


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

PostPosted: Fri Nov 11, 2011 8:31 pm    Post subject:
Reply with quote

Bill,
aren't you glad you asked?
i am. thought this was going to be a dull afternoon.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 11, 2011 8:32 pm    Post subject: Reply to: display variable in call prog when exec the calle
Reply with quote

OK, we'll get there.

A couple of things I want you to add to both programs.

Code:

01  W-WHEN-COMPILED                      PIC X(8)BX(8).


Code:

MOVE WHEN-COMPILED           TO W-WHEN-COMPILED
DISPLAY "your-prog-name-here This program compiled on "
                                                            W-WHEN-COMPILED


This will show you that you are using the correct versions of the programs (or not).

You only need to do this once in each program.

This will also show that the DISPLAY "works".

Confirm that please, and we get to the next bit.[/code]
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1218
Location: Israel

PostPosted: Sat Nov 12, 2011 3:53 pm    Post subject: Re: error
Reply with quote

Bahugun wrote:
*PROCEDURE DIVISION USING WS-INPUT-CITY, WS-OTHER-PARMS.
LINKAGE SECTION.
01 ZZ-USINGPARM1 PIC X(3).
01 ZZ-USINGPARM2 PIC X(341).
PROCEDURE DIVISION USING ZZ-USINGPARM1 , ZZ-USINGPARM2 .
GO TO ZZ-BYPASS-DMSII-SECTION.
ZZ-DMSII-SECTION SECTION.
What has this to do with your question ? Yes, I am confused.
Bahugun wrote:
it is not ESI it is PMS please do not get confused
I googled for PMS... Now I am even more confused! icon_eek.gif
Back to top
View user's profile Send private message
Parvinder Singh

New User


Joined: 06 Sep 2011
Posts: 6
Location: india

PostPosted: Mon Nov 14, 2011 2:45 pm    Post subject:
Reply with quote

Bill Woodger wrote:
Parvinder Singh wrote:
Give Display for Error-Status in pm5020, compile it . recompile pm5054 then run your job. You will get Error-Status contents in sysout. Hope this helps !!!


Curious as to why you'd feel the need to recompile 5054 if not suggesting any changes there. I can't see it as anything but a waste of time?


Sorry Bill, I should write relink instead of recompile, If 5052 is called from 5054 and is static than it should be relinked. Please correct if i am wrong.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Nov 14, 2011 2:49 pm    Post subject: Reply to: display variable in call prog when exec the calle
Reply with quote

Yes, if the call is static it would need to be re-linked. If dynamic everything would just be happy.

Maybe TS has discovered that he wasn't, in whatever way, executing his changed version of the program.
Back to top
View user's profile Send private message
Bahugun

New User


Joined: 07 Jul 2010
Posts: 24
Location: hyderabad

PostPosted: Tue Nov 15, 2011 4:05 pm    Post subject: Reply to: display variable in call prog when exec the calle
Reply with quote

hi all,

i was thinking of different process.

lets declare a varible ERR1 in PM5054 program.
then when the PM5054 program calls PM5020.
then we can move the PMS-ERROR-STATUS to ERR1

and when the control comes back to PM5054 program then we can give the display statement for the ERR1 variable.

i think this process will work.
but i do not know how to implement it

if anyone know how this can be done please let me know.

regards
Bahugun
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
No new posts Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm


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