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

how to get TASK for CICS program


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

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Tue Feb 16, 2010 11:48 am
Reply with quote

Hi,
How to get the task number for the particular COBOL-CICS program.

say in the cobol program i need to store the particular task number.



Code:

    EXEC CICS
       INQUIRE TASK CURRENTPROG('progname')
    END-EXEC.
 
 


i need to store the task number in a working-storage variable.

and how to display that particular task number.

how do i?? well does the above code work and get me the task number???

Please help me out if im wrong.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 16, 2010 4:35 pm
Reply with quote

Please click on the manuals link above, find the CICS Language Reference manual, and look at Appendix A.1.1 on the EIB fields. Pay special attention to EIBTASKN in this chapter. You don't have to issue a CICS command to get the task number -- it is always available to your program anyway.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Wed Feb 17, 2010 6:04 am
Reply with quote

Quote:
EXEC CICS
INQUIRE TASK CURRENTPROG('progname')
END-EXEC.



HUH ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 17, 2010 6:20 am
Reply with quote

Code:
    EXEC CICS
       INQUIRE TASK CURRENTPROG('progname')
    END-EXEC.
And, by the way, this is not standard application code -- this requires use of the CICS system programming interface. If you inquire on the task, CURRENTPROG is not an option for the command; PROGRAM is but PROGRAM does not return a task number -- it returns the 8-character name of the program associated with the current task (i.e., the first program executed in the task chain). Furthermore, note that I said the field is returned -- you cannot specify a literal for the PROGRAM value, only a variable name since it is returned to your program.
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Feb 17, 2010 8:50 am
Reply with quote

Thanks for the help.

I got to know the system properties of a particular CICS task by putting.

CEMD

and then giving the transaction name.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 17, 2010 9:13 am
Reply with quote

Hello,

Quote:
say in the cobol program i need to store the particular task number.
So, what you asked for was not what you actually wanted at all . . .?

What is CEMD?
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Feb 17, 2010 9:27 am
Reply with quote

No,
I wanted to get the task number in the cobol program.

As per the earlier posts i have researched on the 'EIBTASKN' and found the Task number for a particular CICS program.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 17, 2010 9:45 am
Reply with quote

Hello,

As long as you have what you want/need, it does not matter that i'm confused. . . icon_confused.gif

d
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Feb 17, 2010 10:02 am
Reply with quote

I got the resolution by the following statement in my cobol program.

Code:


 MOVE EIBTASKN TO WS-VARIABLE.

  EXEC CICS SEND TEXT           
   FROM  (WS-VARIABLE)             
   RESP  (WS-RESP-CD)   
 END-EXEC.
                   



This would send the TASK number on the screen.

Thanks for the help icon_smile.gif icon_smile.gif
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 Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top