View previous topic :: View next topic
|
Author |
Message |
namitjai
New User
Joined: 12 Feb 2008 Posts: 41 Location: Bangalore
|
|
|
|
Could you please tell me during pseudo conversational programming when user enter some fileds in map and hit ENter then field entered by user will come directly into dfhcommarea field?
Also when we call one program by passing some values then what will be the syntax also please tell me what each field will contain exactly... |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
namitaj,
first of all, fields on screen map do not directly fill in the dfhcommarea field. there is a cobol statement called MOVE that you must code in your program to accomplish,,,
UNLESS you define your BMS map in the dfhcommarea, but then you better make sure there is plenty of DFHCOMMAREA storage defined or your program will abend.
Defining maps in dfhcommarea is not a suggested coding practice.
your second question can not be answered without additional information.
Have you tried reading the CICS Application programmers guide before posting these questions? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
elango wrote: |
hai
The maximum size of DFHCOMMAREA is 32K |
A slight correction. The maximum value in EIBCALEN (the length of the commarea) is 32763 as opposed to 32768 (32K).
Note that the largest value for EIBCALEN is 32K-1. This is due to the fact that EIBCALEN is a signed binary-halfword and 32768 (X'8000') thru 65535 (X'FFFF') would render EIBCALEN as a negative value.
If EIBCALEN were (but it's not) an unsigned binary-halfword, then its maximum value would be 65535 (X'FFFF').
Regards,
Bill |
|
Back to top |
|
|
mymains Currently Banned New User
Joined: 24 Apr 2008 Posts: 5 Location: Banglore
|
|
|
|
Maximum size of Commarea is actually 64k accoding to ibm specifications but it is not possible to pass more than 24 k.
i think it can be corrected .......
|
|
Back to top |
|
|
sachinji84
New User
Joined: 13 Dec 2007 Posts: 14 Location: india
|
|
|
|
Earl Haigh wrote: |
namitaj,
first of all, fields on screen map do not directly fill in the dfhcommarea field. there is a cobol statement called MOVE that you must code in your program to accomplish,,,
UNLESS you define your BMS map in the dfhcommarea, but then you better make sure there is plenty of DFHCOMMAREA storage defined or your program will abend.
Defining maps in dfhcommarea is not a suggested coding practice.
your second question can not be answered without additional information.
Have you tried reading the CICS Application programmers guide before posting these questions? |
Hi,
I was just looking for answer of my query. i found post from you. so i thought to ask you.
please first see the attachment.
Question is : Here as we know in RETURN command we haven’t moved anything in COMMUNICATION-AREA so in second iteration noting will be in DFHCOMMAREA so how the WHEN EIBCALEN =0 has been skipped and control go for other when conditions availabe.
this code is a example from murach book.
snippet posted under the fair use assumption
code inlined and attachment deleted
Code: |
The customer inquiry program
IDENTIFICATION DIVISION.
*
PROGRAM-ID. CUSTINQ1.
*
ENVIRONMENT DIVISION.
*
DATA DIVISION.
*
WORKING-STORAGE SECTION.
*
01 SWITCHES.
*
05 VALID-DATA-SW PIC X VALUE 'Y'.
88 VALID-DATA VALUE 'Y'.
*
01 FLAGS.
*
05 SEND-FLAG PIC X.
88 SEND-ERASE VALUE '1'.
88 SEND-DATAONLY VALUE '2'.
88 SEND-DATAONLY-ALARM VALUE '3'.
*
01 COMMUNICATION-AREA PIC X.
*
01 RESPONSE-CODE PIC S9(8) COMP.
*
01 CUSTOMER-MASTER-RECORD.
*
05 CM-CUSTOMER-NUMBER PIC X(6).
05 CM-FIRST-NAME PIC X(20).
05 CM-LAST-NAME PIC X(30).
05 CM-ADDRESS PIC X(30).
05 CM-CITY PIC X(20).
05 CM-STATE PIC X(2).
05 CM-ZIP-CODE PIC X(10).
*
COPY INQSET1.
*
COPY DFHAID.
*
LINKAGE SECTION.
*
01 DFHCOMMAREA PIC X.
*
PROCEDURE DIVISION.
*
0000-PROCESS-CUSTOMER-INQUIRY.
*
EVALUATE TRUE
*
WHEN EIBCALEN = ZERO
MOVE LOW-VALUE TO INQMAP1O
MOVE 'INQ1' TO TRANIDO
SET SEND-ERASE TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
*
WHEN EIBAID = DFHCLEAR
MOVE LOW-VALUE TO INQMAP1O
MOVE 'INQ1' TO TRANIDO
SET SEND-ERASE TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
*
WHEN EIBAID = DFHPA1 OR DFHPA2 OR DFHPA3
CONTINUE
*
WHEN EIBAID = DFHPF3 OR DFHPF12
EXEC CICS
XCTL PROGRAM('INVMENU')
END-EXEC
*
WHEN EIBAID = DFHENTER
PERFORM 1000-PROCESS-CUSTOMER-MAP
*
WHEN OTHER
MOVE LOW-VALUE TO INQMAP1O
MOVE 'Invalid key pressed.' TO MESSAGEO
SET SEND-DATAONLY-ALARM TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
*
END-EVALUATE.
*
EXEC CICS
RETURN TRANSID('INQ1')
COMMAREA(COMMUNICATION-AREA)
END-EXEC.
*
1000-PROCESS-CUSTOMER-MAP.
*
PERFORM 1100-RECEIVE-CUSTOMER-MAP.
PERFORM 1200-EDIT-CUSTOMER-DATA.
IF VALID-DATA
PERFORM 1300-GET-CUSTOMER-RECORD
END-IF.
IF VALID-DATA
SET SEND-DATAONLY TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
ELSE
SET SEND-DATAONLY-ALARM TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
END-IF.
*
1100-RECEIVE-CUSTOMER-MAP.
*
EXEC CICS
RECEIVE MAP('INQMAP1')
MAPSET('INQSET1')
INTO(INQMAP1I)
END-EXEC.
*
1200-EDIT-CUSTOMER-DATA.
*
IF CUSTNOL = ZERO
OR CUSTNOI = SPACE
MOVE 'N' TO VALID-DATA-SW
MOVE 'You must enter a customer number.' TO MESSAGEO
END-IF.
*
1300-GET-CUSTOMER-RECORD.
*
EXEC CICS
READ FILE('CUSTMAS')
INTO(CUSTOMER-MASTER-RECORD)
RIDFLD(CUSTNOI)
RESP(RESPONSE-CODE)
END-EXEC.
*
EVALUATE RESPONSE-CODE
WHEN DFHRESP(NORMAL)
MOVE SPACE TO MESSAGEO
MOVE CM-LAST-NAME TO LNAMEO
MOVE CM-FIRST-NAME TO FNAMEO
MOVE CM-ADDRESS TO ADDRO
MOVE CM-CITY TO CITYO
MOVE CM-STATE TO STATEO
MOVE CM-ZIP-CODE TO ZIPCODEO
WHEN DFHRESP(NOTFND)
MOVE 'N' TO VALID-DATA-SW
MOVE 'That customer does not exist.' TO MESSAGEO
MOVE SPACE TO LNAMEO
FNAMEO
ADDRO
CITYO
STATEO
ZIPCODEO
WHEN OTHER
EXEC CICS
ABEND
END-EXEC
END-EVALUATE.
*
1400-SEND-CUSTOMER-MAP.
*
EVALUATE TRUE
WHEN SEND-ERASE
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
ERASE
END-EXEC
WHEN SEND-DATAONLY
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
DATAONLY
END-EXEC
WHEN SEND-DATAONLY-ALARM
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
DATAONLY
ALARM
END-EXEC
END-EVALUATE.
|
|
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
I was just looking for answer of my query. i found post from you. so i thought to ask you.
please first see the attachment.
|
First, don't tag onto a thread - start your own query. Mixing queries on a thread will only lead to confusion.
Second, not everybody can download attachmnets, so people have been asked over and over NOT to use attachments.
Garry. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Question is : Here as we know in RETURN command we haven’t moved anything in COMMUNICATION-AREA so in second iteration noting will be in DFHCOMMAREA so how the WHEN EIBCALEN =0 has been skipped and control go for other when conditions availabe. |
The EXEC CICS RETURN has COMMAREA specified. The length of this variable is more than zero, hence EIBCALEN will not be zero the second time into the program. It does not matter whether or not there is anything in the variable -- it has a non-zero length. |
|
Back to top |
|
|
sachinji84
New User
Joined: 13 Dec 2007 Posts: 14 Location: india
|
|
|
|
Robert Sample wrote: |
Quote: |
Question is : Here as we know in RETURN command we haven’t moved anything in COMMUNICATION-AREA so in second iteration noting will be in DFHCOMMAREA so how the WHEN EIBCALEN =0 has been skipped and control go for other when conditions availabe. |
The EXEC CICS RETURN has COMMAREA specified. The length of this variable is more than zero, hence EIBCALEN will not be zero the second time into the program. It does not matter whether or not there is anything in the variable -- it has a non-zero length. |
Thanks for your reply.
But communication area is defined in program as below;
01 COMMUNICATION-AREA PIC X.
It is just a declaration. No value has been passed in this field by program. So DFHCOMMAREA will not receive anything from 1st execution.
As per my knowledge if something has been passed to program through communication area then only EIBCALEN > 0.
Please update me in case I am not correct. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
As per my knowledge if something has been passed to program through communication area then only EIBCALEN > 0. |
In this case your knowledge is incorrect. The fact that a commarea exists means that it has a length - even if there is "no data" in that commarea.
Any program which receives a commarea or task that is started with a commarea will have EIBCALEN > 0 regardless of whether there is valid data in that commarea.
Garry. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
01 COMMUNICATION-AREA PIC X.
It is just a declaration. |
What do you mean -- "just a declaration"??? It is a valid COBOL variable, it has a length, the length is 1, and the value of the byte could be anything from x'00' to x'FF'. If you look at the data map from your program compile, you will see this variable listed and there will be a BL cell offset to indicate that COBOL knows where the variable is in memory. This is not "just a declaration" -- this is a COBOL variable. |
|
Back to top |
|
|
|