Monday, December 5, 2011

COMMUNICATION AREA



  • At the time of terminating the transaction, the working storage – section variables are stored into a variable declared in linkage section

  • This area is called communication area

  • It is global

  • The max six of this variable is 6JK.

(linkage Section)

              01 DFHCOMMAREA PIC  X  (65,53J)

  • At the time of reinitiation  the data is retrieve from the variable

  • Communication Area can be used to pass the data from on transaction to another.

  • For the first entry of transaction the Communication Area is empty

  • For next entry, it must not be zero.

PROCEDURE DIVISION
 If EIBCALEN = 0
     To check the length of Communication Area, it is zero for first entry, non zero                                                 For next entry.
Exec CICS

        Send
                MAP (MAPNAME)
         
               MAPSET (MAPSET)
End – exec
Exec CICS

        Return
                   Transid (“TR01”)
End-Exec
Else
        Exec CICS
                    Receive MAP (MAPNAME)
                                 MAPSET (MAPSET)
End – Exec

End-it
Cust.No.  …….
Cust Name ……..
Message: ………

Enter  F2   F3   F4
 
If EIBCALEN = 0

            Exec CICS
                        Send
                                    MAP(MAPNAME)
                                    MAPSET(MAPSETNAME)
End – Exec

Exec CICS                                                                                           Functionlays
                        Return                                                                                                
                                    Transid)”TR01”)                                                                       Stored
                                                                                                                EIBAID
End – Exec.

End – If                                                                                        DFHAID    Attention Identifers
                                                                                                                                    (F1 –F24)
Perform Receive- Map – Para three Receive – Map – Exit
Perform Function – Keys – Para three Function – Keys – Exit
Receive – Map – Para

Exec  CICS

                            Receive
                                     MAP(MAPNAME)                                 Copy DFHAID in WS - Section
                                     MAPSET(MAPSETNAME)
            End – Exec                                                                 01  EIBAID   PIC   X(4)
                                                                                                    88 DFHPF1 Value  “F1”
Receive – Map – Exit                                                                     88 DFHPF2 Value “F2”
                                                                                                      88 DFHEnter Value “Enter”                      Exit

Function – Keys – Para

            Evaluate EIBAID
                        When DFHEnter                                                     88 DFHPF24 Value “F24”
 

                                    Perform validation – logic three validation – logic – exit
                        When DFHPF3

                                    Pefrom Exit – logic three exit – logic –Exit
                        When DFHPF10
                       
                                    Perform Insert – logic three Insert – logic – Exit

                        When DFHPF11

                                    Perform update – logic three update – logic – Exit
                        When Other

                                    Perform Invalid – Key three Invalid – Key – Exit

            End – Evaluate



Function – keys – exit                                                             In map
                                                                                                 1 line  --- Header
                              Exit                                                            23line   --- Messages
                                                                                                24 or last  --- Footer
Validation – logic

      If McnstNoI   = Zeroes
                  Move “Invalid cust. No.” to MMESGO
                   Exec CICS   Move  - 1 to McnstNol – Dynomic way to position the cursor
                            Send
                                   MAP (MAP NAME)
                                     MAPSET(MAPSETNAME)
                       
                             End – Exec
                            
Exec CICS                                                         To Dynamically position the         
                                                                                    cursor
              Return                                                       1. Move – 1 to Mcnst NoL
                         Transid(“TR01”)                                                i.e. Lengthfield
                                                                                2. Send
     End – Exec                                                                 Map (…………….)
                        End if                                                                               Map (…………….)
                                                                                                                Cursor (200) relative
            If Mcnst NoI No is not Numeric                                                         cursor position
           
              Move Spaces to MMESGO
              Move “Must be Numeric” to MMESGO

Move  - 1  to Mcnst NoL
                        Exec CICS
                                Send
                                                MAP (MAPNAME)
                                                MAPSET(MAPSETNAME)
                        End –exec

                        Exec CICS                                                                   Send Para

                                 Return

                                                Transid(“TR01”)
                        End – Exec
                        End if
If Mcnst NoI (1:1) < > 1
            Move Spaces To MMESGO
            Move “First digit Must be 1” to MMESGO
            Move – 1 To McnstNoL
Exec CICS
            Send
                        MAP(MAPNAME)
                        MAPSET(MAPSET NAME)
End – Exec
Exec CICS
            Return
                        Transid (“TR01”)
End-Exec   End-If
Move McnstNoI to (DFHCommArea(1:5)) Ws-Cust-No

If McnstNamI   = Spaces
           
            Move  “Invalid Name” to MMESGO
            Move – 1 toMcnstNamL
            Perform Send – Para

End If

            Move McnstNamI to(DFHCommArea(6:10)) Ws-Cust-Name
           
            Move Ws-Comm-area to DFHcommArea

No comments:

Post a Comment