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
 

 

Assembler Instruction to Display data in Spool
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Fri May 13, 2011 6:26 pm    Post subject: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri May 13, 2011 6:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Fri May 13, 2011 6:50 pm    Post subject: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri May 13, 2011 7:28 pm    Post subject: Reply to: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri May 13, 2011 7:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Mon May 16, 2011 2:32 pm    Post subject: Re: Reply to: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon May 16, 2011 3:01 pm    Post subject:
Reply with quote

FWIW, I would use a snapdump of my working storage(s). Works as a charm.
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 11:04 am    Post subject: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue May 17, 2011 11:52 am    Post subject:
Reply with quote

You should use the EXECUTE and LIST form of WTO in this case.
See the following example :

http://www.longpelaexpertise.com.au/ezine/ReentrantBeginners.php
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 12:42 pm    Post subject: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue May 17, 2011 1:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 1:18 pm    Post subject: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Tue May 17, 2011 1:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Tue May 17, 2011 1:39 pm    Post subject:
Reply with quote

@ 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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue May 17, 2011 2:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 3:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue May 17, 2011 3:29 pm    Post subject:
Reply with quote

There is no length field preceding your outrec, and you dont have a branch to other coding after your DISMSG3.
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 3:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Tue May 17, 2011 3:36 pm    Post subject: Re: Assembler Instruction to Display data in Spool
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 3:46 pm    Post subject: Assembler Instruction to Display data in Spool
Reply with quote

Hi Nihal,

The Job has displayed VINAY in JESMSGLG but the job abended with SOC1.
What might be the reason?
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 -> PL/I & Assembler 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 ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm
No new posts FTP Server and FTP.DATA vasanthz All Other Mainframe Topics 2 Wed Oct 12, 2016 11:49 pm


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