IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to do a display within an assembler Transaction?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Fri Feb 13, 2009 1:20 pm
Reply with quote

Hello,

is it possible to do a display (or something like that) within an assembler transaction in CICS?

I am new on this system and only found the possibility to debug by using CEDF. But to my knowledge CEDF only stops on EXEC-CICS commands.

I know want to code some lines in the program to see if this section was entered or not. Best would be if i could print out some values of my Variables, but just nice to have ;)

Does anybody know how to do?

Best regards
Andi
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Feb 13, 2009 2:26 pm
Reply with quote

Two things that I found handy in working with assembler code running under CICS, a self written macro to do a display and a soft command (like a handle) to stop the CEDF....
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Fri Feb 13, 2009 2:30 pm
Reply with quote

Is it very complicated to write such a macro? Can you give me a hint how to do this???
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

PostPosted: Fri Feb 13, 2009 8:14 pm
Reply with quote

One approach might be to use external TDQ to hold the messages you want to output. This is pretty much how I've seen high-level languages do it.

For a one-off, or the first instance, just EXEC CICS WRITEQ TD the data. If you need something reuseable, develop a macro to build the necessary message from variables and/or constants.

Garry.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Feb 13, 2009 8:26 pm
Reply with quote

Adding to Garry's reply, TDQ "CESE" is the destination where messages are routed to (under the covers) using the COBOL "DISPLAY" Verb.

I wouldn't recommend WTO's.

If your Assembler program is LE enabled, review the CEEMOUT Callable Service routine.

Regards,
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Feb 13, 2009 8:41 pm
Reply with quote

springle your target assembler code with

EXEC CICS ASSIGN USERID

statements
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Fri Feb 13, 2009 8:44 pm
Reply with quote

Hey,

the solution using a TDQ sounds really good. Nobody of us ever heard about this.

Just played arround in CICS by typing in "CEMT I QUE" and got a list looking like that:

Code:
CEMT I QUE                                                                   
STATUS:  RESULTS - OVERTYPE TO MODIFY                                       
 Que(ARLS) Tri( 00001 ) Int Ena     Tra(ARLS) Des(    )                     
 Que(AUFS) Tri( 00001 ) Int Ena     Tra(DRES) Des(    )                     
 Que(AUFT) Tri( 00001 ) Int Ena     Tra(DREP) Des(    )                     
 Que(CADL)              Ind(CPLI)                                           
 Que(CCSE)              Ind(CPLI)                                           
 Que(CCSO)              Ind(CPLI)                                           
 Que(CESE)              Ext Ena Ope                                         
 Que(CESO)              Ext Ena Ope                                         
 Que(CPLD)              Ind(CPLI)                                           
 Que(CPLI)              Ext Ena Ope                                         
 Que(CSCC)              Ind(CPLI)                                           
 Que(CSCS)              Ind(CPLI)                                           
 Que(CSDL)              Ind(CPLI)                                           
 Que(CSML)              Ind(CPLI)                                           
 Que(CSMT)              Ind(CPLI)                                           
 Que(CSSL)              Ind(CPLI)                                           
 Que(CSTL)              Ind(CPLI)                                           
 Que(CXRF)              Ext Ena Ope                                         
                                                                             
                                                              APPLID=APPCCIC1
 RESPONSE: NORMAL                       TIME:  16.09.04  DATE: 13.02.09     
F 1 HELP       3 END                    7 SBH 8 SFH 9 MSG 10 SB 11 SF       


There we can see the Queue which Bill O'Boyle talked about.

But should we create a new queue for our debugging or can we use one of those queues?

And how can we look on the data in the queue after we wrote data into the queue?

Many many many thanks for your help!

Best regards Andi
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

PostPosted: Fri Feb 13, 2009 9:13 pm
Reply with quote

You can use one of the existing "Ext" queues. If you do, your messages may be interspersed with messages from other tasks. How you view them depends on how the external dataset is resolved. If it's a SYSOUT dataset, you can access via SDSF. If a file, browse the file.

Since messages may be buffered, I've found that closing (and immediately re-opening) the TDQ cause buffered messages to be written.

Garry.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Feb 13, 2009 11:04 pm
Reply with quote

Use the CESE that COBOL displays go to....
Put a unique identifier followed by a timestamp followed by what ever data you want to display, it will make it easier to find.....
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Mon Feb 16, 2009 2:20 pm
Reply with quote

Hello again,

I found a cics transaktion to view the TS-QUEUES online (CEBR). Via CECI i tried to put a message into the QUEUE 'CESE'. This worked fine.

Now i started a test with my online assembler transaction with this code:

Code:
TQMESSG  DC    CL5'HALLO'                                         
         EXEC CICS WRITEQ TS QUEUE('CESE') FROM(TQMESSG) LENGTH(5)


But this code causes a dump. Do I have to do something else before I put a message online to this TS-QUEUE???

Best regards
Andi
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

PostPosted: Mon Feb 16, 2009 2:27 pm
Reply with quote

How does execution get to the EXEC CICS command? You can't execute
Code:
TQMESSG  DC    CL5'HALLO'
. You need to branch around it.

Garry.
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Mon Feb 16, 2009 2:33 pm
Reply with quote

Hey,

thanks for the fast answer. But i do not really understand what you mean with "you need to branch around it".

I just copied an existing EXEC CICS Statement from this program:

Code:
EXEC CICS LINK PROGRAM('DCPAMA1') COMMAREA(DCNPTR) LENGTH(28)


This i changed into
Code:
TQMESSG  DC    CL5'HALLO'                                         
         EXEC CICS WRITEQ TS QUEUE('CESE') FROM(TQMESSG) LENGTH(5)


Would be nice if you can give me an example of what you mean.

Andi
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

PostPosted: Mon Feb 16, 2009 3:06 pm
Reply with quote

For example...

Code:
TQPROG     DFHEIENT
TQPROG     AMODE 31
TQPROG     RMODE ANY
*         
           EXEC CICS WRITEQ TS QUEUE('CESE') FROM(TQMESSG) LENGTH(5)
           EXEC CICS RETURN
*
TQMESSG    DC    CL5'HALLO'
           END 



or
Code:
TQPROG      DFHEIENT
TQPROG      AMODE 31
TQPROG      RMODE ANY
*
            B       WRITEQ 
TQMESSG     DC    CL5'HALLO'
*       
WRITEQ      EQU   *
            EXEC CICS WRITEQ TS QUEUE('CESE') FROM(TQMESSG) LENGTH(5)
            EXEC CICS RETURN
*
            END 



The literal 'HALLO' cannot be in the instruction path...


Garry.
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Mon Feb 16, 2009 3:28 pm
Reply with quote

WOW! Thank you very mutch, this was the solution!ยด

Now it works fine and i can see the messages in the transaction CEBR.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

PostPosted: Mon Feb 16, 2009 3:41 pm
Reply with quote

You're welcome. I'm glad to have been of help and thanks for letting us know that it worked for you.

Garry.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Feb 16, 2009 7:53 pm
Reply with quote

You can dynamically specify the LENGTH. based upon the length of the label.

EG -

Instead of LENGTH(5), specify LENGTH(=Y(L'TQMESSQ)) or LENGTH(=AL2(L'TQMESSG))

The difference between a "Y" directive and an "AL2" directive is that the "Y" directive is halfword aligned. Either one will generate the correct length.

IIRC, if you don't specify the LENGTH, the translator generates a "Y" directive anyway.

Regards,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Start CICS transaction every day at 2AM CICS 4
No new posts How to display the leading zeros of a... DB2 7
No new posts Getting SOC4 while calling a Cobol DB... PL/I & Assembler 4
No new posts Passing parm from JCL to Assembler, b... PL/I & Assembler 2
No new posts Assembler class assignment: stuck on ... PL/I & Assembler 12
Search our Forums:

Back to Top