cobolwannabe
Programmer
I need help with a program
I have a part of the project working already I will be using micro-focus in
a
mainframe evironment to compile & run the program the program is for a CICS
class
that I am currently taking.
The next phase of the program will
1. Transfer control from the menu to the inquiry program. The user will
select
business function "1" to affect the transfer. At a time, the inquiry program
will
display an initial screen with a message, and/or process the return to the
menu
screen when appropriate PF key is used.
This is the decision matrix for the program
if the requesting program is inqpgm1
receive the map & continue processing
edit the flight # field for valid numeric entry
if valid
place the character "x" in all alpha map fields, & or place a "9"
format date & time fields with appropriate separators.
display and informational message indicating that the users request will be
processed
if the entry is in error
display an appropriate error message set color & atrributes for flight
message in
accordance with standards for error processing
send map inq01m
return control to CICS with Transid "inq1"
if the requestion program is menupgm
send initialized map inq01m
return control to CICS with transid "inq1"
if the requesting program is any value not already specified transfer
control to program
menupgm transid menu using dfhcomarea length of 30 requestion program name
inqpgm1
transfer contral to program menupgm, trans-id menu using the dfhcomarea
length of 30
redisplay a fresh map
send the error message invalid key selected try again
return control to CICS with transid inq1
Below is the part of the program that already works
IDENTIFICATION DIVISION.
PROGRAM-ID. MENU.
******************************************************
** LAB 3
**
**
** THE PROGRAM WILL DISPLAY A MENU & LET THE USER MAKE A
** SELECTION FORM THE MENU OPTIONS 1-4
******************************************************
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WORKING-STORAGE-START.
05 FILLER PIC X(27)
VALUE 'WORKING STORAGE STARTS HERE'.
01 END-OF-SESSION-MSG PIC X(13) VALUE 'YOUR ARE DONE'.
01 ENTER-ERROR-MSG PIC X(45)
VALUE 'INVALID ACTION SELECTED,CORRECT AND TRY AGAIN'.
01 FUNCTN-ERROR-MSG PIC X(36)
VALUE 'INVALID KEY PRESSED PLEASE TRY AGAIN'.
01 CORRECT-MSG PIC X(46)
VALUE 'YOUR SELECTION HAS BEEN SUCCESSFULLY PROCESSED'.
01 COMMUNICATION-AREA.
05 WS-REQ-PGM PIC X(8) VALUE SPACES.
05 WS-FLT-NBR PIC X(04) VALUE SPACES.
05 WS-FILLER PIC X(18) VALUE SPACES.
COPY MENUMAP.
COPY DFHAID.
COPY ATTR.
01 WORKING-STORAGE-STOP.
05 FILLER PIC X(27)
VALUE 'WORKING STORAGE STOPS HERE'.
LINKAGE SECTION.
01 DFHCOMMAREA.
05 LS-REQ-PGM PIC X(8) VALUE SPACES.
05 LS-FLT-NBR PIC X(04) VALUE SPACES.
05 LS-FILLER PIC X(18) VALUE SPACES.
PROCEDURE DIVISION.
***********************************************
** start the process, evaluate what type of
** interrupt has occured and direct the processing
** flow accordingly.
** once all processing has occured, return to CICS
** using your transid and dfhcommarea.
***********************************************
0000-MAINLINE.
EVALUATE TRUE
WHEN EIBCALEN = ZERO
MOVE LOW-VALUE TO MENU01MO
PERFORM 8000-SEND-MAP-WITH-RETURN
WHEN LS-REQ-PGM = 'MENUPGM'
PERFORM 0100-EVALUATE-EIB
WHEN LS-REQ-PGM = 'MENUMAP'
* you are returning from someother valid program
* in this system. send the map for this program
PERFORM 8000-SEND-MAP-WITH-RETURN
WHEN OTHER
* you've got some type of error handle it
MOVE LOW-VALUE TO MENU01MI
MOVE ENTER-ERROR-MSG TO ERRMSGO
MOVE ATTR-RED TO ERRMSGC
MOVE ATTR-RED TO CHOICEC
END-EVALUATE.
***********************************************
** you are returning to this program,
** find out what attention identifier key
** was press to start the event.
***********************************************
0100-EVALUATE-EIB.
EVALUATE TRUE
WHEN EIBAID = DFHCLEAR
PERFORM 8000-SEND-MAP-WITH-RETURN
WHEN EIBAID = DFHPF3
PERFORM 9000-SEND-TERMINATION-MESSAGE
WHEN EIBAID = DFHENTER
PERFORM 1000-START-PROCESSING-MAP
WHEN OTHER
MOVE LOW-VALUE TO MENU01MO
MOVE FUNCTN-ERROR-MSG TO ERRMSGO
MOVE -1 TO ERRMSGL
MOVE ATTR-RED TO ERRMSGC
PERFORM 8000-SEND-MAP-WITH-RETURN
END-EVALUATE.
***********************************************
** this is where you would start your editing
** based on the type of processing requested
***********************************************
1000-START-PROCESSING-MAP.
PERFORM 2000-RECEIVE-MAP.
PERFORM 5000-EDIT-DATA.
PERFORM 8000-SEND-MAP-WITH-RETURN.
***********************************************
** recieve the map/mapset into your working
** storage map copy book
***********************************************
2000-RECEIVE-MAP.
EXEC CICS
RECEIVE MAP('MENU01M')
MAPSET('MENUMAP')
INTO(MENU01MI)
END-EXEC.
***********************************************
** this is where you would start your data edits
***********************************************
5000-EDIT-DATA.
EVALUATE CHOICEI
WHEN '1'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN '2'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN '3'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN '4'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN OTHER
MOVE -1 TO CHOICEL
MOVE ENTER-ERROR-MSG TO ERRMSGO
MOVE ATTR-RED TO CHOICEC
MOVE ATTR-RED TO ERRMSGC
END-EVALUATE.
***********************************************
** send the map/mapset from the output area
** of you copybook.
***********************************************
8000-SEND-MAP-WITH-RETURN.
MOVE 'MENUPGM' TO WS-REQ-PGM
EXEC CICS
SEND MAP('MENU01M')
MAPSET('MENUMAP')
FROM(MENU01MO)
ERASE
CURSOR
END-EXEC.
EXEC CICS
RETURN TRANSID('MENU')
COMMAREA(COMMUNICATION-AREA)
LENGTH(30)
END-EXEC.
***********************************************
** clear the screen and send a sign off message
** that you build in working storage
** return control to the system
***********************************************
9000-SEND-TERMINATION-MESSAGE.
EXEC CICS
SEND TEXT FROM(END-OF-SESSION-MSG)
ERASE
FREEKB
LENGTH(13)
END-EXEC.
EXEC CICS
RETURN
END-EXEC.
****** END OF PROGRAM *************************
I have a part of the project working already I will be using micro-focus in
a
mainframe evironment to compile & run the program the program is for a CICS
class
that I am currently taking.
The next phase of the program will
1. Transfer control from the menu to the inquiry program. The user will
select
business function "1" to affect the transfer. At a time, the inquiry program
will
display an initial screen with a message, and/or process the return to the
menu
screen when appropriate PF key is used.
This is the decision matrix for the program
if the requesting program is inqpgm1
receive the map & continue processing
edit the flight # field for valid numeric entry
if valid
place the character "x" in all alpha map fields, & or place a "9"
format date & time fields with appropriate separators.
display and informational message indicating that the users request will be
processed
if the entry is in error
display an appropriate error message set color & atrributes for flight
message in
accordance with standards for error processing
send map inq01m
return control to CICS with Transid "inq1"
if the requestion program is menupgm
send initialized map inq01m
return control to CICS with transid "inq1"
if the requesting program is any value not already specified transfer
control to program
menupgm transid menu using dfhcomarea length of 30 requestion program name
inqpgm1
transfer contral to program menupgm, trans-id menu using the dfhcomarea
length of 30
redisplay a fresh map
send the error message invalid key selected try again
return control to CICS with transid inq1
Below is the part of the program that already works
IDENTIFICATION DIVISION.
PROGRAM-ID. MENU.
******************************************************
** LAB 3
**
**
** THE PROGRAM WILL DISPLAY A MENU & LET THE USER MAKE A
** SELECTION FORM THE MENU OPTIONS 1-4
******************************************************
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WORKING-STORAGE-START.
05 FILLER PIC X(27)
VALUE 'WORKING STORAGE STARTS HERE'.
01 END-OF-SESSION-MSG PIC X(13) VALUE 'YOUR ARE DONE'.
01 ENTER-ERROR-MSG PIC X(45)
VALUE 'INVALID ACTION SELECTED,CORRECT AND TRY AGAIN'.
01 FUNCTN-ERROR-MSG PIC X(36)
VALUE 'INVALID KEY PRESSED PLEASE TRY AGAIN'.
01 CORRECT-MSG PIC X(46)
VALUE 'YOUR SELECTION HAS BEEN SUCCESSFULLY PROCESSED'.
01 COMMUNICATION-AREA.
05 WS-REQ-PGM PIC X(8) VALUE SPACES.
05 WS-FLT-NBR PIC X(04) VALUE SPACES.
05 WS-FILLER PIC X(18) VALUE SPACES.
COPY MENUMAP.
COPY DFHAID.
COPY ATTR.
01 WORKING-STORAGE-STOP.
05 FILLER PIC X(27)
VALUE 'WORKING STORAGE STOPS HERE'.
LINKAGE SECTION.
01 DFHCOMMAREA.
05 LS-REQ-PGM PIC X(8) VALUE SPACES.
05 LS-FLT-NBR PIC X(04) VALUE SPACES.
05 LS-FILLER PIC X(18) VALUE SPACES.
PROCEDURE DIVISION.
***********************************************
** start the process, evaluate what type of
** interrupt has occured and direct the processing
** flow accordingly.
** once all processing has occured, return to CICS
** using your transid and dfhcommarea.
***********************************************
0000-MAINLINE.
EVALUATE TRUE
WHEN EIBCALEN = ZERO
MOVE LOW-VALUE TO MENU01MO
PERFORM 8000-SEND-MAP-WITH-RETURN
WHEN LS-REQ-PGM = 'MENUPGM'
PERFORM 0100-EVALUATE-EIB
WHEN LS-REQ-PGM = 'MENUMAP'
* you are returning from someother valid program
* in this system. send the map for this program
PERFORM 8000-SEND-MAP-WITH-RETURN
WHEN OTHER
* you've got some type of error handle it
MOVE LOW-VALUE TO MENU01MI
MOVE ENTER-ERROR-MSG TO ERRMSGO
MOVE ATTR-RED TO ERRMSGC
MOVE ATTR-RED TO CHOICEC
END-EVALUATE.
***********************************************
** you are returning to this program,
** find out what attention identifier key
** was press to start the event.
***********************************************
0100-EVALUATE-EIB.
EVALUATE TRUE
WHEN EIBAID = DFHCLEAR
PERFORM 8000-SEND-MAP-WITH-RETURN
WHEN EIBAID = DFHPF3
PERFORM 9000-SEND-TERMINATION-MESSAGE
WHEN EIBAID = DFHENTER
PERFORM 1000-START-PROCESSING-MAP
WHEN OTHER
MOVE LOW-VALUE TO MENU01MO
MOVE FUNCTN-ERROR-MSG TO ERRMSGO
MOVE -1 TO ERRMSGL
MOVE ATTR-RED TO ERRMSGC
PERFORM 8000-SEND-MAP-WITH-RETURN
END-EVALUATE.
***********************************************
** this is where you would start your editing
** based on the type of processing requested
***********************************************
1000-START-PROCESSING-MAP.
PERFORM 2000-RECEIVE-MAP.
PERFORM 5000-EDIT-DATA.
PERFORM 8000-SEND-MAP-WITH-RETURN.
***********************************************
** recieve the map/mapset into your working
** storage map copy book
***********************************************
2000-RECEIVE-MAP.
EXEC CICS
RECEIVE MAP('MENU01M')
MAPSET('MENUMAP')
INTO(MENU01MI)
END-EXEC.
***********************************************
** this is where you would start your data edits
***********************************************
5000-EDIT-DATA.
EVALUATE CHOICEI
WHEN '1'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN '2'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN '3'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN '4'
MOVE ATTR-YELLOW TO ERRMSGC
MOVE ATTR-GREEN TO CHOICEC
MOVE -1 TO CHOICEL
MOVE CORRECT-MSG TO ERRMSGO
WHEN OTHER
MOVE -1 TO CHOICEL
MOVE ENTER-ERROR-MSG TO ERRMSGO
MOVE ATTR-RED TO CHOICEC
MOVE ATTR-RED TO ERRMSGC
END-EVALUATE.
***********************************************
** send the map/mapset from the output area
** of you copybook.
***********************************************
8000-SEND-MAP-WITH-RETURN.
MOVE 'MENUPGM' TO WS-REQ-PGM
EXEC CICS
SEND MAP('MENU01M')
MAPSET('MENUMAP')
FROM(MENU01MO)
ERASE
CURSOR
END-EXEC.
EXEC CICS
RETURN TRANSID('MENU')
COMMAREA(COMMUNICATION-AREA)
LENGTH(30)
END-EXEC.
***********************************************
** clear the screen and send a sign off message
** that you build in working storage
** return control to the system
***********************************************
9000-SEND-TERMINATION-MESSAGE.
EXEC CICS
SEND TEXT FROM(END-OF-SESSION-MSG)
ERASE
FREEKB
LENGTH(13)
END-EXEC.
EXEC CICS
RETURN
END-EXEC.
****** END OF PROGRAM *************************