View previous topic :: View next topic
|
Author |
Message |
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Hi all,
I am working with a CICS program, which will read the data in tables and publish on the screen in first run, and In the second run of the program i.e. after pressing any key on the screen, Program has to read the data on the screen and then should compare with the data read in the first run to check whether data is changed or not and then process data as appropriate...
So I am storing the data read in the tables in the first run in the field (Lets say only one field) in DFHCOMMAREA... and I am displaying the data stored in the field of DFHCOMMAREA in the last statement of the First Run... But when I check to display the same field in the DFHCOMMAREA in the first statement of the Second Run... I found that the data is lost...
So any guess or any suggestions in this situation...
Please ask further details to find the solution,
Thanks,
-Mike... |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Is your program checking for presence of COMMAREA ?
Code: |
IF EIBCALEN GREATER THAN ZEROES |
and if, present, addressing that COMMAREA ?
Code: |
SET ADDRESS OF YOUR-LINKAGE TO ADDRESS OF DFHCOMMAREA. |
Also, does the first run end with?
Code: |
EXEC CICS RETURN TRANSID(EIBTRNID) COMMAREA(YOUR-COMMAREA) |
Garry. |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Garry,
Thanks for your quick reply...
Actually, my program is not starting any transaction or not calling any program...
I assume that after
900-SEND-NIEUW-SCHERM SECTION.
EXEC CICS
SEND
MAP(SCHERM-NAAM-LA)
MAPSET(MAPSET-NAAM-LA)
FROM(SCHERM)
ERASE
END-EXEC.
900-UIT.
EXIT.
The connection breaks and resume after any key... Am I thinking in a correct way....
When user enters any data and press any key... I guess again the program reenter with initialized Working-storage values, retaining DFH COMMAREA... am I correct..
I checked whether EIBCALEN is greater than zero or not... it is greater than zero only...
I did not do addressing of that COMMAREA? Is it necessary, if so I request you to explain its importance and usage in briefly.. Thanks..
And finally, I am not calling any TRANSID after first run...
Please ask me if you need more information,
Thanks,
-Mike. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
SET ADDRESS OF YOUR-LINKAGE TO ADDRESS OF DFHCOMMAREA.
you shouldn't have to code this.
what release level of CICS are you on ?
cics translator handles addressability.. |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Thanks Earl...
I am currently using V3R4 version,
I dont have any idea whether CICS translator handles addressability...
But, I assume that it handles as I do not find such statements on glabal search of my mainframe,
Thanks,
-mike. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
When user enters any data and press any key... I guess again the program reenter with initialized Working-storage values, retaining DFH COMMAREA... am I correct.. |
No, the way you describe, CICS sees each "Enter" as starting a totally unrelated task and there is no COMMAREA.
After your EXEC CICS SEND MAP.... you must EXEC CICS RETURN to return control correctly to CICS.
By coding EXEC CICS RETURN TRANSID(EIBTRNID) COMMAREA(your-commarea), you are telling CICS the transaction name for the next time the user presses Enter (EIBTRNID = same TRANSID name) and where the COMMAREA is located. By testing EIBCALEN you can tell wehether or not there is a COMMAREA - if it's there, you need to address it.
Garry. |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Gary thanks for your answer...
If this is the case, then it will be little complicated as my Transaction ID lets say KD00... which starts with b100 screen and then b200 screen and then b300 screen and then b400 screen...
By b400 screen, our program execution starts, then here I can't give as you said like "EXEC CICS RETURN TRANSID(EIBTRNID) COMMAREA(your-commarea)", Because when users enters any key again the flow starts from B100 Screen, b200 screen etc.... This will go infinite loop...
Please correct me, if I misunderstood your statements,
Thanks,
-Mike. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
I think your understanding of how CICS works is flawed.
A pseudo-conversation is made up of a series of transactions associated by passed COMMAREAs. Each task in a pseudo-conversation describes a particular part of the entire conversation.
Each transaction runs from start to the EXEC CICS RETURN. The user doesn't get to press enter until the RETURN is executed.
So, first time in, EIBCALEN is zero, so you read the tables, build the screen, populate COMMAREA and EXEC CICS RETURN.
The user then gets the opportunity to modify the data (or not) and press Enter or PFkey. Now, the transaction nominated in the EXEC CICS RETURN is launched but this time there is a COMMAREA (EIBCALEN > 0). You now get the opportunity to RECEIVE MAP and compare with the COMMAREA. If the two match, you probably don't need to go to the table again. |If they don't you may want to update the table?
Garry. |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Gary Thanks.
To Check my statements, I checked whether the EIBCALEN is greater than zero or not in my first run as well...
And the display statements shows that EIBCALEN is greater than zero..
Cheers,
-Mike. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
EIBCALEN will only be greater than zero if another transaction has passed a COMMAREA to the current transaction.
If you see EIBCALEN greater than zero the first time, the transaction must have been started by a task passing it a COMMAREA.
How does your initial transaction get launched?
Garry. |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Garry,
The Initial Transaction starts with transaction id KD00.
My program is K32BI010. The program which calls K32BI010 is K32BH010.
In K32BH010, The statements are as follows,
MOVE 'K32BI010' TO MODULE-NAAM-LA
MOVE 'K32B001' TO MAPSET-NAAM-LA
MOVE 'K32B200' TO SCHERM-NAAM-LA
After this next paragraph is
310-LOCK-OPHEFFEN SECTION.
MOVE AAND-OMGEVING-LA TO AAND-OMGEVING-AE1.
MOVE AAND-DATABASE-LA TO AAND-DATABASE-AE1.
SET LOCK-OPHEFFEN-AE1 TO TRUE.
MOVE SCHANR-LA TO SCHANR-AE1.
PERFORM 830-LINK-K32AE100.
310-UIT.
EXIT.
THE PROGRAM K32AE100 check whether we have to use production or test data here...
900-LINK-HTPMVSNQ SECTION.
EXEC CICS
LINK
PROGRAM ('HTPMVSNQ')
COMMAREA (LINK-H03BE)
END-EXEC.
IF PARMFOUT-H03BE
PERFORM 990-ABEND.
900-UIT.
EXIT.
The program 'HTPMVSNQ' is some assembler program I guess....
Cheers. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
I would say, from this, that K32BH010 is passing a COMMAREA to your program. This would explain why you see EIBCALEN > 0 every time.
You need to know that K32BH010 will RETURN the data from your COMMAREA and that you haven't compromised his COMMAREA in any way. It may be necessary to extend the COMMAREA toprovide an area for you to add your data. Will your processing affect the next iteration(s) of K32BH010?
Another option might be to store the table data in TSQ so that you can read it back in. If you get a QIDERR, then you haven't yet saved the data - otherwise you can compare. Essentially, any mechanism that passes the data and that doesn't interfere with other's programs' use of that mechanism is what you want.
Garry. |
|
Back to top |
|
|
|