COBOL Screens .


59 views
Uploaded on:
Description
Scrntest.cbl. Distinguishing proof DIVISION. PROGRAM-ID. SCROCCUR. Creator. Merchant. ENVIRONMENT DIVISION. Information OUTPUT SECTION. Record CONTROL. SELECT INPUT-FILE ASSIGN TO \"C:\\PCOBWIN\\CIS12FST\\SCR1.DAT\". Information DIVISION. Document SECTION. FD INPUT-FILE DATA RECORD IS INPUT-REC. 01 INPUT-REC. 05 ID-IN
Transcripts
Slide 1

COBOL Screens Please utilize speaker notes for extra data!

Slide 2

Scrntest.cbl IDENTIFICATION DIVISION. PROGRAM-ID. SCROCCUR. Creator. Food merchant. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. Document CONTROL. SELECT INPUT-FILE ASSIGN TO "C:\PCOBWIN\CIS12FST\SCR1.DAT". Information DIVISION. Document SECTION. FD INPUT-FILE DATA RECORD IS INPUT-REC. 01 INPUT-REC. 05 ID-IN PIC XXXX. 05 NAME-IN PIC X(20). WORKING-STORAGE SECTION. 01 INDICATORS. 05 EOF-IND PIC XXX VALUE "NO ". 01 RESPONSES. 05 SCR-RESP-WS PIC X VALUE SPACES. 05 CUR PIC 99 VALUE 4. 05 CT PIC 9 VALUE 0. Data from the screen is put away here. Reactions utilized as a part of handling.

Slide 3

Scrntest.cbl Header data showed at the highest point of the screen. SCREEN SECTION. 01 DATA-SCREEN. 05 HDR-INFO. 10 VALUE "DATA SCREEN" BLANK SCREEN LINE 01 COL 30. 10 VALUE "ID #" LINE 03 COL 12. 10 VALUE "NAME" LINE 03 COL 17. 05 INFO-SCR-IN. 10 ID-ON-SCR-IN LINE CUR COL 12 PIC XXXX FROM ID-IN. 10 NAME-ON-SCR-IN LINE CUR COL 17 PIC X(20) FROM NAME-IN. 05 RESP-INFO. 10 VALUE "C - TO CONTINUE" LINE 16 COL 30. 10 VALUE "Q - TO QUIT" LINE 17 COL 30. 10 VALUE "ENTER CHOICE:" LINE 19 COL 30. 10 RESPONSE-SCR LINE 19 COL 45 PIC X TO SCR-RESP-WS. Methodology DIVISION. MAINLINE. Play out A-100-INITIALIZE. PERFORM B-100-PROCESS. PERFORM C-100-TERMINATE. STOP RUN. Detail data showed on the present line. Take note of that CUR is set to 4 and will be augmented so the primary line is shown on line 5. This structure permits the developer to show various duplicates of INFO-SCR-IN. The client will enter either C to proceed or Q to stop when the RESP-INFO part of the screen is shown.

Slide 4

Screen indicating yield HDR INFO-SCR-IN RESP-INFO

Slide 5

Scrntest.cbl Performs the standard which will set up the rehashing lines of data until either CT which checks the record is more noteworthy than 4, or EOF is come to or the client stops. A-100-INITIALIZE. OPEN INPUT-FILE. B-100-PROCESS. Perused INPUT-FILE AT END MOVE "YES" TO EOF-IND. PERFORM B-200-LOOP UNTIL EOF-IND = "YES" OR SCR-RESP-WS = "Q". B-200-LOOP. MOVE 4 TO CUR. MOVE 0 TO CT. Show HDR-INFO. PERFORM B-300-SETUP UNTIL CT > 4 OR EOF-IND = "YES" OR SCR-RESP-WS = "Q". Show RESP-INFO. Acknowledge RESP-INFO. B-300-SETUP. ADD 1 TO CUR. ADD 1 TO CT. Show INFO-SCR-IN. Perused INPUT-FILE AT END MOVE "YES" TO EOF-IND. C-100-TERMINATE. CLOSE INPUT-FILE. Shows the header data on the screen. At the point when the B-300-SETUP circle is done, the reaction screen is shown and the client reaction is acknowledged. This closures the go through the B-200-LOOP, In this B-300-SETUP loop,1 is added to the present line, CUR and to the CT which is numbering the records. At that point the data is shown and another record is perused.

Slide 6

IDENTIFICATION DIVISION. PROGRAM-ID. SCROCCUR. Creator. Food merchant. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. Document CONTROL. SELECT INPUT-FILE ASSIGN TO "C:\PCOBWIN\CIS12FST\SCR1.DAT". Information DIVISION. Document SECTION. FD INPUT-FILE DATA RECORD IS INPUT-REC. 01 INPUT-REC. 05 ID-IN PIC XXXX. 05 NAME-IN PIC X(20). WORKING-STORAGE SECTION. 01 INDICATORS. 05 EOF-IND PIC XXX VALUE "NO ". 01 RESPONSES. 05 SCR-RESP-WS PIC X VALUE SPACES. 05 CUR PIC 99 VALUE 4. 05 SUBZ PIC 9 VALUE 0. 01 DATA-FOR-SCREEN. 05 INFO-FOR-SCR OCCURS 5 TIMES. 10 ID-IN-WS PIC XXXX. 10 NAME-IN-WS PIC X(20). Scroccur.cbl

Slide 7

01 DATA-FOR-SCREEN. 05 INFO-FOR-SCR OCCURS 5 TIMES. 10 ID-IN-WS PIC XXXX. 10 NAME-IN-WS PIC X(20). Scroccur.cbl SCREEN SECTION. 01 DATA-SCREEN. 05 HDR-INFO. 10 VALUE "DATA SCREEN" BLANK SCREEN LINE 01 COL 30. 10 VALUE "ID #" LINE 03 COL 12. 10 VALUE "NAME" LINE 03 COL 17. 05 INFO-SCR-IN. 10 ID-ON-SCR-IN LINE CUR COL 12 PIC XXXX FROM ID-IN-WS (SUBZ). 10 NAME-ON-SCR-IN LINE CUR COL 17 PIC X(20) FROM NAME-IN-WS (SUBZ). 05 RESP-INFO. 10 VALUE "C - TO CONTINUE" LINE 16 COL 30. 10 VALUE "Q - TO QUIT" LINE 17 COL 30. 10 VALUE "ENTER CHOICE:" LINE 19 COL 30. 10 RESPONSE-SCR LINE 19 COL 45 PIC X TO SCR-RESP-WS. Method DIVISION. MAINLINE. Play out A-100-INITIALIZE. PERFORM B-100-PROCESS. PERFORM C-100-TERMINATE. STOP RUN.

Slide 8

A-100-INITIALIZE. OPEN INPUT-FILE. B-100-PROCESS. Perused INPUT-FILE AT END MOVE "YES" TO EOF-IND. PERFORM B-200-LOOP UNTIL EOF-IND = "YES" OR SCR-RESP-WS = "Q". B-200-LOOP. MOVE 4 TO CUR. MOVE 0 TO SUBZ. Show HDR-INFO. PERFORM B-300-SETUP UNTIL SUBZ > 4 OR EOF-IND = "YES" OR SCR-RESP-WS = "Q". Show RESP-INFO. Acknowledge RESP-INFO. B-300-SETUP. ADD 1 TO SUBZ. ADD 1 TO CUR. MOVE ID-IN TO ID-IN-WS(SUBZ). MOVE NAME-IN TO NAME-IN-WS (SUBZ). Show INFO-SCR-IN. Perused INPUT-FILE AT END MOVE "YES" TO EOF-IND. C-100-TERMINATE. CLOSE INPUT-FILE. Scroccur.cbl The record that was perused is in ID-IN and NAME-IN> These two fields are currently moved to the table in WORKING-STORAGE that gives the data to the screen. A data is moved to the table, it is shown on the screen.

Recommended
View more...