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

pseudo conversational programming


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

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Thu Apr 24, 2008 3:37 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Apr 24, 2008 7:05 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Apr 24, 2008 7:23 pm
Reply with quote

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
View user's profile Send private message
mymains
Currently Banned

New User


Joined: 24 Apr 2008
Posts: 5
Location: Banglore

PostPosted: Fri Apr 25, 2008 3:15 pm
Reply with quote

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 .......
icon_smile.gif
Back to top
View user's profile Send private message
sachinji84

New User


Joined: 13 Dec 2007
Posts: 14
Location: india

PostPosted: Fri Jun 17, 2011 3:55 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Jun 17, 2011 4:07 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Jun 17, 2011 4:49 pm
Reply with quote

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
View user's profile Send private message
sachinji84

New User


Joined: 13 Dec 2007
Posts: 14
Location: india

PostPosted: Mon Jun 20, 2011 2:20 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Jun 20, 2011 2:27 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Jun 20, 2011 2:57 pm
Reply with quote

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
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 Cobol-DB2 Programming - Better perfor... DB2 1
No new posts Learning about Systems Assembler prog... PL/I & Assembler 5
No new posts CICS file processing using applicatio... CICS 3
No new posts conversational program not reading t... IMS DB/DC 2
No new posts COBOL Programming Sandpit? COBOL Programming 6
Search our Forums:

Back to Top