|
|
| Author |
Message |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
Hi,
I am trying to implement pseudo-conversation in PL/I. But i am struck at the declaration of DFHCOMMAREA.
could anyone tell me how & where to declare DFHCOMMAREA?
Also how to implement pseudoconversation in PL/I? |
|
| Back to top |
|
 |
References
|
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 3277 Location: italy
|
|
|
|
the same way as in any other language
wherever You feel confortable to enhance program readability,
pli does not have the COBOL idiosyncrasies about &working_storage variable placement
... process the data
... write to the screen
... RETURN TRANSID |
|
| Back to top |
|
 |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
I am trying out this program which is not working for me. Kindly guide me.
[ the map displays five fields of a record fetched from database table ]
PGM:
PROCEDURE OPTIONS(MAIN);
%INCLUDE M862;
EXEC SQL INCLUDE SQLCA;
EXEC SQL INCLUDE EMPL9354; /* DCLGEN of table EMPLOYEE */
EXEC CICS IGNORE CONDITION
MAPFAIL;
DCL DFHCOMMAREA CHAR(5) STATIC;
DCL COMMAREA_DATA CHAR(5);
DCL EMP_KEY CHAR(5);
IF EIBCALEN=0 THEN
DO;
COMMAREA_DATA='AAAAA';
CALL SEND_MAP;
CALL RETURN_CTRL;
END;
ELSE
DO;
COMMAREA = DFHCOMMAREA;
SELECT(EIBAID);
WHEN(DFHENTER)
DO;
CALL RECEIVE_MAP;
CALL PROCESS_PROC;
END;
WHEN(DFHPF3)
DO;
CALL EXIT_PGM;
END;
END;
END;
SEND_MAP:PROC;
EXEC CICS SEND MAP('MAP') MAPSET('M862') FREEKB ERASE;
END SEND_MAP;
RECEIVE_MAP:PROC;
EXEC CICS RECEIVE MAP('MAP') MAPSET('M862');
END RECEIVE_MAP;
RETURN_CTRL:PROC;
EXEC CICS RETURN
TRANSID('SR01')
COMMAREA(COMMAREA_DATA)
LENGTH(5);
END RETURN_CTRL;
PROCESS_PROC:PROC;
EMP_KEY = FIELD1I;
EXEC SQL SELECT EMPNAME INTO :DCLEMPLOYEE
FROM EMPLOYEE
WHERE EMPNO=:EMP_KEY;
IF SQLCODE = 0 THEN
BEGIN;
FIELD2I = WS_EMPNAME
FIELD3I = WS_ADDRESS
FIELD4I = WS_CONTACT
FIELD5I = WS_DOB
CALL SEND_MAP;
CALL RETURN_CTRL;
END;
END PROCESS_PROC;
EXIT_PGM: PROC;
EXEC CICS
SEND CONTROL
ERASE;
END EXIT_PGM;
END PGM;
END PGM; |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 3277 Location: italy
|
|
|
|
| not working is a bit generic, as a symptom |
|
| Back to top |
|
 |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
| The transaction gets abended with abend code=4038. What might be the reason for this? |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 3277 Location: italy
|
|
|
|
| Quote: |
U4038 (X'FC6')
Explanation: The enclave ended with an unhandled Language Environment software-raised or user-raised condition of severity 2 or greater, and the run-time option ABTERMENC(ABEND) was specified.
Programmer Response: Check the Language Environment message file for message output.
System Action: Enclave terminated. |
|
|
| Back to top |
|
 |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
Can you be more specific regarding Language Environment?
I never encountered this when i run COBOL-CICS programs.
Even when I execute a simple program which just sends a message to the CICS terminal, i have not encountered this abend code. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9183 Location: 221 B Baker St
|
|
|
|
Hello,
The U4038 is also somewhat generic.
There is additional diagnostic information somewhere and you will need to find/post that.
Many systems have some standard error handling code - is such available on your system? This will not fix the abend, but will help clrify what is wrong.
You might also talk with your system support people. |
|
| Back to top |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 189 Location: Dublin, Ireland
|
|
|
|
Just an observation: You have coded:
DCL DFHCOMMAREA CHAR(5) STATIC;
Use of PL/1 STATIC variables is really a "no-no" in CICS. Use of STATIC variables makes the program non-reentrant as STATIC storage are part opf the program itself. Another instance of the task can modify such variables, giving you unexpected results. |
|
| Back to top |
|
 |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
| ok.. then how to declare dfhcommarea? My intention here is to retain data between successive invocations of the transaction. Hence, I declared it as static. |
|
| Back to top |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 189 Location: Dublin, Ireland
|
|
|
|
| Code: |
DCL MY_COMMAREA CHAR(5);
EXEC CICS RETURN TRANSID(EIBTRNID) COMMAREA(MY_COMMAREA);
|
the next iteration of the transaction will have a non-zero EIBCALEN |
|
| Back to top |
|
 |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
k.. what if I want to process based on commarea contents?
in cobol i will move contents of dfhcommarea to my_commarea and process it. the contents of dfhcommarea s retained between transaction execution.
here how can i fetch the contents of commarea? |
|
| Back to top |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 189 Location: Dublin, Ireland
|
|
|
|
For example
| Code: |
MY_PROG: PROC(COMM_POINTER) OPTIONS(MAIN REENTRANT);
DCL COMM_POINTER POINTER;
DCL PASSED_COMMAREA CHAR(5) BASED(COMM_POINTER);
DCL MY_COMMAREA CHAR(5);
IF EIBCALEN > 0
then do;
/* Code for 1st time in */
end;
else do;
/* Code for all instances with a passed commarea */
MY_COMMAREA = PASSED_COMMAREA;
end;
EXEC CICS RETURN TRANSID(EIBTRNID) COMMAREA(MY_COMMAREA);
END MY_PROG;
|
The address of the current instance of MY_COMMAREA is passed as a parameter to the next iteration of the transaction. The started transaction then has EIBCALEN > 0 and moves the data from the passed area to the program variable. |
|
| Back to top |
|
 |
ranjini_S01
New User
Joined: 15 Feb 2008 Posts: 12 Location: bangalore
|
|
|
|
Thanks a lot!!
I have made the suggested changes. Even then i am getting abend code of 4038.
When the transaction is executed, the map is sent to the terminal for the first time and then the control is returned.
When I enter the data and press ENTER, the transaction gets abended.
Kindly suggest me the solution.
Is it related to compiler options? |
|
| Back to top |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 189 Location: Dublin, Ireland
|
|
|
|
Abend 4038 is a generic abend. Have you checked CEEMSG/PLIMSG in the CICS region output for any diagnostic info? you may need to close the TD queue to see messages.
OK, looking back at your earlier posted code, there are a few other things I'd change:
You shouldn't CALL RETURN_CTRL. This implies an expected return after the call which is not what happens. Instead, have RETURN_CTRL as a label in the program, not as a PROC and GOTO RETURN_CTRL.
Your code to call EXIT_PGM should also be a GOTO and is incomplete. The last thing you have to do when exiting a CICS program is EXEC CICS RETURN. In this case, have EXIT_PGM as another label and add EXEC CICS RETURN after the EXEC CICS SEND CONTROL ERASE.
You also have no action taken where SQLCODE ¬= 0. If you get a bad return from DB2, then you exit PROCESS_PROC and go nowhere, you don't even return control to CICS. You should have an EXEC CICS RETURN of some form executed here.
Have you stepped through the transaction in EDF? |
|
| Back to top |
|
 |
|
|