Guest User

Untitled

a guest
Jan 14th, 2020
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IDENTIFICATION DIVISION.
  2. *
  3. PROGRAM-ID. CMINQG2C.
  4. *
  5. ENVIRONMENT DIVISION.
  6. *
  7. DATA DIVISION.
  8. *
  9. WORKING-STORAGE SECTION.
  10. *
  11. 01 SWITCHES.
  12. *
  13. 05 VALID-DATA-SW PIC X VALUE 'Y'.
  14. 88 VALID-DATA VALUE 'Y'.
  15. *
  16. 01 FLAGS.
  17. *
  18. 05 SEND-FLAG PIC X.
  19. 88 SEND-ERASE VALUE '1'.
  20. 88 SEND-DATAONLY VALUE '2'.
  21. 88 SEND-DATAONLY-ALARM VALUE '3'.
  22. *
  23. 01 COMMUNICATION-AREA PIC X.
  24. *
  25. 01 RESPONSE-CODE PIC S9(8) COMP.
  26. *
  27. 01 CUSTOMER-MASTER-RECORD.
  28. *
  29. 05 CM-CUSTOMER-NUMBER PIC X(6).
  30. 05 CM-FIRST-NAME PIC X(20).
  31. 05 CM-LAST-NAME PIC X(30).
  32. 05 CM-ADDRESS PIC X(30).
  33. 05 CM-CITY PIC X(20).
  34. 05 CM-STATE PIC X(2).
  35. 05 CM-ZIP-CODE PIC X(10).
  36. *
  37. COPY INQSG2C.
  38. *
  39. COPY DFHAID.
  40. *
  41. LINKAGE SECTION.
  42. *
  43. 01 DFHCOMMAREA PIC X.
  44. *
  45. PROCEDURE DIVISION.
  46. *
  47. 0000-PROCESS-CUSTOMER-INQUIRY.
  48. *
  49. EVALUATE TRUE
  50. *
  51. WHEN EIBCALEN = ZERO
  52. MOVE LOW-VALUE TO INQMG2CO
  53. MOVE 'IG2C' TO TRANIDO
  54. SET SEND-ERASE TO TRUE
  55. PERFORM 1400-SEND-CUSTOMER-MAP
  56. *
  57. WHEN EIBAID = DFHCLEAR
  58. MOVE LOW-VALUE TO INQMG2CO
  59. MOVE 'IG2C' TO TRANIDO
  60. SET SEND-ERASE TO TRUE
  61. PERFORM 1400-SEND-CUSTOMER-MAP
  62. *
  63. WHEN EIBAID = DFHPA1 OR DFHPA2 OR DFHPA3
  64. CONTINUE
  65. *
  66. * WHEN EIBAID = DFHPF3 OR DFHPF12
  67. * EXEC CICS
  68. * XCTL PROGRAM('INVMENU')
  69. * END-EXEC
  70. *
  71. WHEN EIBAID = DFHENTER
  72. PERFORM 1000-PROCESS-CUSTOMER-MAP
  73. *
  74. WHEN OTHER
  75. MOVE LOW-VALUE TO INQMG2CO
  76. MOVE 'Invalid key pressed.' TO MESSAGEO
  77. SET SEND-DATAONLY-ALARM TO TRUE
  78. PERFORM 1400-SEND-CUSTOMER-MAP
  79. *
  80. END-EVALUATE.
  81. *
  82. EXEC CICS
  83. RETURN TRANSID('IG2C')
  84. COMMAREA(COMMUNICATION-AREA)
  85. END-EXEC.
  86. *
  87. 1000-PROCESS-CUSTOMER-MAP.
  88. *
  89. PERFORM 1100-RECEIVE-CUSTOMER-MAP.
  90. PERFORM 1200-EDIT-CUSTOMER-DATA.
  91. IF VALID-DATA
  92. PERFORM 1300-GET-CUSTOMER-RECORD
  93. END-IF.
  94. IF VALID-DATA
  95. SET SEND-DATAONLY TO TRUE
  96. PERFORM 1400-SEND-CUSTOMER-MAP
  97. ELSE
  98. SET SEND-DATAONLY-ALARM TO TRUE
  99. PERFORM 1400-SEND-CUSTOMER-MAP
  100. END-IF.
  101. *
  102. 1100-RECEIVE-CUSTOMER-MAP.
  103. *
  104. EXEC CICS
  105. RECEIVE MAP('INQMG2C')
  106. MAPSET('INQSG2C')
  107. INTO(INQMG2CI)
  108. END-EXEC.
  109. *
  110. 1200-EDIT-CUSTOMER-DATA.
  111. *
  112. IF CUSTNOL = ZERO
  113. OR CUSTNOI = SPACE
  114. MOVE 'N' TO VALID-DATA-SW
  115. MOVE 'You must enter a customer number.' TO MESSAGEO
  116. END-IF.
  117. *
  118. 1300-GET-CUSTOMER-RECORD.
  119. *
  120. EXEC CICS
  121. READ FILE('CUSTMAS')
  122. INTO(CUSTOMER-MASTER-RECORD)
  123. RIDFLD(CUSTNOI)
  124. RESP(RESPONSE-CODE)
  125. END-EXEC.
  126. *
  127. IF RESPONSE-CODE = DFHRESP(NORMAL)
  128. MOVE SPACE TO MESSAGEO
  129. MOVE CM-LAST-NAME TO LNAMEO
  130. MOVE CM-FIRST-NAME TO FNAMEO
  131. MOVE CM-ADDRESS TO ADDRO
  132. MOVE CM-CITY TO CITYO
  133. MOVE CM-STATE TO STATEO
  134. MOVE CM-ZIP-CODE TO ZIPCODEO
  135. ELSE IF RESPONSE-CODE = DFHRESP(NOTFND)
  136. MOVE 'N' TO VALID-DATA-SW
  137. MOVE 'That customer does not exist.' TO MESSAGEO
  138. MOVE SPACE TO LNAMEO
  139. FNAMEO
  140. ADDRO
  141. CITYO
  142. STATEO
  143. ZIPCODEO
  144. ELSE
  145. EXEC CICS
  146. ABEND
  147. END-EXEC
  148. END-IF.
  149. *
  150. 1400-SEND-CUSTOMER-MAP.
  151. *
  152. EVALUATE TRUE
  153. WHEN SEND-ERASE
  154. EXEC CICS
  155. SEND MAP('INQMG2C')
  156. MAPSET('INQSG2C')
  157. FROM(INQMG2CO)
  158. ERASE
  159. END-EXEC
  160. WHEN SEND-DATAONLY
  161. EXEC CICS
  162. SEND MAP('INQMG2C')
  163. MAPSET('INQSG2C')
  164. FROM(INQMG2CO)
  165. DATAONLY
  166. END-EXEC
  167. WHEN SEND-DATAONLY-ALARM
  168. EXEC CICS
  169. SEND MAP('INQMG2C')
  170. MAPSET('INQSG2C')
  171. FROM(INQMG2CO)
  172. DATAONLY
  173. ALARM
  174. END-EXEC
  175. END-EVALUATE.
RAW Paste Data