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

Relation (Logical) between Transaction or Task


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

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Tue Mar 09, 2010 3:32 pm
Reply with quote

Hi All,

Can anyone tell me what is the relation (Logical) between:
1. Transaction or Task# and
2. CICS application programs.

Also i want to know if
1) An CICS Application program can execute multiple tasks or
2) One task can have multiple CICS programs being executed.

Regards
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 Mar 09, 2010 3:56 pm
Reply with quote

There is basically no relationship between task number and CICS application programs. When you key in a transaction name, that transaction is assigned a task number. When you display a map and return to CICS with a START command, after hitting enter (or a PF/PA key) you will have a new task number -- even though this may be the same program running. Using XCTL or LINK will not change the task number, but START will. One task may execute any number of CICS programs via XCTL or LINK.

Quote:
An CICS Application program can execute multiple tasks
I do not know what this means. If you're asking if a single program can be executed in multiple tasks (transactions), the answer is yes of course. If you are asking if a program can start multiple transactions, the answer is yes of course (but watch out for terminal interactions). If you are asking something else, you need to clarify just what you are wanting to know.
Back to top
View user's profile Send private message
arun nehra

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Tue Mar 09, 2010 5:10 pm
Reply with quote

This means the new task (or transaction) creation is functionality (performed) dependent. Example if am using five separate PF keys to perform five different functions it will create five separate tasks.

Also "An CICS Application program can execute multiple tasks" says (taking above scenario into consideration) - Pressing one PF key can trigger multiple tasks or transactions that may execute some functionality within same program or separate (by calling) programs.

Please let me know if i am correct/incorrect. Sorry in case if this is confusing you.

Regards
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 Mar 09, 2010 5:56 pm
Reply with quote

Quote:
This means the new task (or transaction) creation is functionality (performed) dependent. Example if am using five separate PF keys to perform five different functions it will create five separate tasks.
Maybe -- depending upon the application coding. Normally, hitting a PF key causes the associated transaction to be started, and it will be the same program in all cases. That program may then start a different task depending upon which PF key was hit, but there's no requirement for this -- the program may very well handle the PF key logic internally so there would only be the one task number. You would not, however, expect to be able to hit 5 successive PF keys and have the same program handle all of them -- unless your program logic is coded to keep starting the transaction after each PF key. Without specific coding in the application, hitting the second PF key will generate a CICS error message since CICS will not know how to handle the key.

Quote:
Pressing one PF key can trigger multiple tasks or transactions that may execute some functionality within same program or separate (by calling) programs.
This is poorly stated at best, wrong depending upon what you mean. A single CICS program can execute multiple EXEC CICS START TRANSACTION commands -- and each will have a unique task number. However, you cannot use these tasks as if they are subroutines; each is running an independent program that (unless the application is coded specifically to handle this) knows absolutely nothing about any other transactions that were started by the original task.

Perhaps if you explained what you are attempting to accomplish, we could provide better insight.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Mar 09, 2010 5:59 pm
Reply with quote

Hi Arun,

Quote:
An CICS Application program can execute multiple tasks
For a user who is just using the transaction/screen this might be the case because when they use the program they feel that they are able to perform different tasks.

When we speak in terms of application programmers it should be noted that (as per your design) each PF key is triggering a transaction which is a new task for that particular CICS session. So am not sure whether we can term as "program can execute multiple tasks" rather I would term as a "program can initiate multiple tasks" as Robert have mentioned already...
Back to top
View user's profile Send private message
arun nehra

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Tue Mar 09, 2010 6:36 pm
Reply with quote

I was looking for a generic statement:

A program can initiate multiple tasks (using different PF keys) and also a task can be performed by executing (or calling) multiple programs (i.e using either Link or XCTL). Please correct me if i am wrong.


"the program may very well handle the PF key logic internally so there would only be the one task number"
Also if above is true when we go for a new task using CICS 'START' command.

Regards
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Mar 09, 2010 6:50 pm
Reply with quote

Hi Arun,

i think you are in a deadlock situation... icon_lol.gif

Suggest you understand what a "task#" is with respect to CICS ... Please go through Robert's post (first one) once again ... Do let us know if any confustion still remains...

Quote:
Also if above is true when we go for a new task using CICS 'START' command.
START is usually used for multithreading i.e. when you want simultaneous transactions to run parallely... It depends on your design on how and when you code it...
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 Mar 09, 2010 7:04 pm
Reply with quote

Quote:
A program can initiate multiple tasks (using different PF keys) and also a task can be performed by executing (or calling) multiple programs (i.e using either Link or XCTL). Please correct me if i am wrong.
You are wrong. A task is a very specific thing in CICS and you cannot just throw the term around willy-nilly. A task is defined in section 1.1.2 of the CICS Application Programming Guide as
Quote:
Task
You will also see the word task used extensively in CICS documentation. This word also has a specific meaning in CICS. When CICS receives a request to run a transaction, it starts a new task that is associated with this one instance of the execution of the transaction. type. That is, one execution of a transaction, with a particular set of data, usually on behalf of a particular user at a particular terminal. You can also consider it as analogous to a thread.. When the transaction completes, the task is terminated.
You seem to be confused about "transaction" and "task" -- they are not the same thing at all. The only ways a program initiates a task is via EXEC CICS START TRANSID or RETURN TRANSID -- which may or may not involve any PF keys at all. There are other ways (such as APPC) to initiate tasks but we will ignore them for now.

Example:
You sign onto the CICS region. You enter transaction identifier ABCD and hit the enter key. At this point, a task is established with a unique number, call it 12345, and this task is associated with your terminal T123 and transaction ABCD (which means program ABCD0000 since a transaction is always tied to a program). Program ABCD0000 does some set up, sends a map, and then does EXEC CICS RETURN TRANSID(ABCD). At this point you enter data into the map -- note that there is NO transaction running, no task assigned to your terminal since you are interacting with the terminal map. When you hit the enter key (or a PF key, PA key, CLEAR key, and so forth), CICS starts up transaction ABCD, assigning a new unique task number 12353, and proceeds to invoke your program ABCD0000. This will happen no matter what PF key is hit -- and you cannot say to execute transaction ZYXW if PF key 9 is hit. Every program whether invoked via XCTL or LINK will share the task number 12353 until either EXEC CICS RETURN TRANSID or EXEC CICS START TRANSID are executed. If the first case, the same process repeats. In the second case, an independent task number, say 12361, is assigned to the started transaction, and both transaction 12353 and transaction 12361 are executing (although this partly depends upon how the START TRANSID was done -- if both are tied to your terminal T123 then 12361 won't actually get any data from your terminal until 12353 is complete).
Back to top
View user's profile Send private message
arun nehra

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Tue Mar 09, 2010 7:42 pm
Reply with quote

Many thanks to all,

Looks like i need to a have more deep study about above topics. Could you please suggest some thing on this if possible.

Regards
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Mar 09, 2010 7:51 pm
Reply with quote

Hi Arun,

To understand the concept, I cant suggest anything better than the example Robert has given you in his last post... Suggest you read that a couple of times and am pretty sure that will clear away all your doubts on this topic...

and then there is always the Manuals which is available (link available on the top of this page) ... icon_cool.gif
Back to top
View user's profile Send private message
arun nehra

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Tue Mar 09, 2010 8:04 pm
Reply with quote

Thanks Bionop for your suggesion. I will do the needful.

Once again thanks all for all your help and guidance.

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 Rotate partition-logical & physic... DB2 0
No new posts How to identify the transaction categ... IMS DB/DC 3
No new posts Started task using a generation dataset JCL & VSAM 7
No new posts Batch call online program, EXCI task ... CICS 3
No new posts Run a simple JOB as Started Task All Other Mainframe Topics 4
Search our Forums:

Back to Top