View previous topic :: View next topic
|
Author |
Message |
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi,
I want to display some fields or data in spool for debugging purpose.
Can anyone tell me assembler instruction equivalent to 'DISPLAY' in COBOL which can be coded in Assembler to display data? Thanks
Regards,
Vinay |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
There is no equivalent statement in Assembler to COBOL's DISPLAY statement. You could write your own routine as a macro but you'll have to handle format conversions yourself. |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
But to write a Macro, what is it that we need to use to display the data in spool. Is it we need to use PUT instruction only? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
You could use a WTO, with ROUTCDE=(11), which writes to JESMSGLG.
But, check with site operations staff before you do this.
Bill |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You would need to define a DCB in the program, open it, set up the print line, and PUT the data -- closing the file when through with it. Your JCL would have that DD name set to SYSOUT=* (or appropriate value for your site). |
|
Back to top |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
Yes, you could use WTO macro
The syntax should be:
Code: |
DISMSG WTO TEXT=WTOAR,ROUTCDE=11 |
Add a halfword named WTOAR before the Area in storage you want to display. For example:
Code: |
WTOAR DC H'40'
WRKAR EQU *
FLDA DS CL20
FLDB DS PL4 |
..... and so on
The halfword WTOAR is the length of bytes that will be displayed. Make sure its not too long( always < 80 bytes)
Routcde=11 will route your message to Jesysmsg in your spool. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
FWIW, I would use a snapdump of my working storage(s). Works as a charm. |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi Nihal,
I am facing an ABEND SD23 when I used below instructions to display in JESMSG
DISMSG WTO TEXT=MSG1,ROUTCDE=11
MSG1 DC CL5'VINAY'
However the Job went fine when I used
DISMSG WTO 'PROGRAM TESTPGM EXECUTING'
I want to display contents of a variable or Register. Can you please tell me how can I do that? Thanks |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi Peter,
I used the same way it has been mentioned in the example you have mentioned. But I am getting SOC1 abend.
LA R3,MSG1
DISMSG WTO TEXT=(R3)
MSG1 DC AL2(L'MSG1TXT)
MSG1TXT DC C'PROGRAM TESTPGM EXECUTING' |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Is MSG1 and MSG1TXT immediate after your WTO instruction? If thats the case no wonder your program abends. WTO might abnormally terminate with abend code X'D23' not with a 0C1. |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Yes. MSG1 and MSG1TXT are immediate after the WTO instruction.
May I know the reason for ABEND if they are just after WTO instruction?
Do I need to write them at the end of the program? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Morning Sir !
If you only want to display some simple messages to simply track your programm flow, a simple WTO at several places would do.
WTO 'This is: Label-13'
...or more flexible:
MVC WTOMSG1+017(008),=C'Label-13'
...
...
WTOMSG1 WTO 'This is: xxxxxxxx'
WTO-Command uses 8 Bytes itsself. So the first Byte for a text-Char is
wto-label+8. In this example the Wto message is modified by a former MVC. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ vinayknj
Quick response to your last question.
Your wto was not followed by any instruction.
Your wto was followed by a define-constant.
So you got a illegal instruction |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
UmeySan wrote: |
@ vinayknj
Quick response to your last question.
Your wto was not followed by any instruction.
Your wto was followed by a define-constant.
So you got a illegal instruction |
Thanks for repeating my comment. |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi Peter/Umeysan
Please let me know what is wrong with below instructions. I am getting SD23 Abend...
DISMSG4 WTO TEXT=OUTREC
OPEN (OUTFLE,(OUTPUT))
DISMSG2 WTO 'OPEN OUTPUT FILE SUCCESS'
PUT OUTFLE,OUTREC
DISMSG3 WTO 'WRITE OUTPUT FILE SUCCESS'
OUTREC DC 0CL15
FNAME DC CL5'VINAY'
LNAME DC CL5'KUMAR'
MNAME DC CL5'NAMA '
OUTFLE DCB DDNAME=OUTFILE, +
DSORG=PS, +
LRECL=80, +
MACRF=(PM), +
RECFM=FB |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
There is no length field preceding your outrec, and you dont have a branch to other coding after your DISMSG3. |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi Peter/Umeysan,
Please let me know what is wrong with the below instructions. I am getting SOC1 abend.
OPEN (OUTFLE,(OUTPUT))
DISMSG2 WTO 'OPEN OUTPUT FILE SUCCESS'
PUT OUTFLE,OUTREC
DISMSG3 WTO 'WRITE OUTPUT FILE SUCCESS'
DISMSG6 WTO 'BEFORE DEFINE OUTREC'
OUTREC DC 0CL15
FNAME DC CL5'VINAY'
LNAME DC CL5'KUMAR'
MNAME DC CL5'NAMA '
DISMSG4 WTO 'AFTER DEFINE OUTREC'
OUTFLE DCB DDNAME=OUTFILE, +
DSORG=PS, +
LRECL=80, +
MACRF=(PM), +
RECFM=FB
XR R15,R15
JESMSGS shows 'OPEN OUTPUT FILE SUCCESS' , 'WRITE OUTPUT FILE SUCCESS' , 'BEFORE DEFINE OUTREC' and doesn't display anything that i have given after the OUTREC.
Kindly suggest. Thanks |
|
Back to top |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
vinayknj wrote: |
Hi Nihal,
I am facing an ABEND SD23 when I used below instructions to display in JESMSG
DISMSG WTO TEXT=MSG1,ROUTCDE=11
MSG1 DC CL5'VINAY'
|
Vinay,
you need to have a detailed look at the code sample I gave in my first comment for this thread.
The first 2 bytes of your MSG1 field is the length of the number of characters or bytes you want to display. Try the below code as is and see the result:
Code: |
DISMSG WTO TEXT=MSG1,ROUTCDE=11
MSG1 DC H'40'
DC CL5'VINAY'
FILLER DC 80CL1' ' |
Quote: |
DISMSG WTO 'PROGRAM TESTPGM EXECUTING' |
Yes, this will run ok because the length of the string is precalculated by the WTO macro itself |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi Nihal,
The Job has displayed VINAY in JESMSGLG but the job abended with SOC1.
What might be the reason? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
vinayknj wrote: |
Hi Nihal,
The Job has displayed VINAY in JESMSGLG but the job abended with SOC1.
What might be the reason? |
Once again, you try to execute working storage after your WTO because you dont branch to executable code. If you dont understand that, stop trying to write an assembler program. And your SD23 abends are a result of not providing the length of your text. For the rest read the manual :
MVS Programming: Authorized
Assembler Services Reference, Volume 4
(SETFRR-WTOR) |
|
Back to top |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
vinayknj wrote: |
Hi Nihal,
The Job has displayed VINAY in JESMSGLG but the job abended with SOC1.
What might be the reason? |
Vinay,
From the error(S0C1) I guess that: you need to keep the WTO macro statement in the executable part of your program. MSG1 should be kept in the work area of your program(i.e. the part where you keep rest of your variables/fields).
A general rule is :Whenever you write a program control should never reach your work area.
This has already been suggested by a few others in the Forum. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
As has been said, you need to perform making your data readable, such as a register content, R1 for example -
Code: |
DWORD DS D
WORKAREA DS CL16
ST R1,DWORD STORE IN 1ST-WORD
UNPK WORKAREA(9),DWORD(5) UNPACK AS 9-BYTES
XC DWORD,DWORD ENSURE X'00'S
MVZ WORKAREA(8),DWORD CLEAR ALL ZONES
TR WORKAREA(8),=CL16'0123456789ABCDEF'
|
Depending on the location in the program, you could remove the XC and MVZ and change the Translate-Table to =CL16'0123456789ABCDEF'-240, but the above will work for you and would be a different discussion for a different day.
When all is said and done, the readable register value can be found in WORKAREA(8).
Bill |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@Peter
Make assurance double sure & Better safe than sorry
...in terms of repeating comments
As you could see in the last posts, it's still the same |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Thanks Nihal/peter. Sorry for troubling u with silly questions.
I understood that we shouldn't execute the data fields and we should branch to the instructions instead.
I included below Branch instruction but still I am getting SOC1 abend.
DISMSG WTO TEXT=MSG1,ROUTCDE=11
B BACK .
MSG1 DC H'05'
DC CL5'VINAY'
FILLER DC 80CL1' '
BACK XR R15,R15
RETURN
END |
|
Back to top |
|
|
|