***READ PS & DISPLAY THE RECORD IN SPOOL BASED ON A CONDITION*****
IDENTIFICATION DIVISION. 00010000
PROGRAM-ID. FILEHAND. 00050000
AUTHOR. SRIBLOG. 00051000
DATE-WRITTEN. NOV 26, 2013. 00052000
DATE-COMPILED. NOV 26, 2013. 00053000
ENVIRONMENT DIVISION. 00054000
INPUT-OUTPUT SECTION. 00054100
FILE-CONTROL. 00055000
SELECT BI00S-CRICKET ASSIGN TO DD1 00056000
ORGANIZATION IS SEQUENTIAL 00057000
ACCESS MODE IS SEQUENTIAL 00058000
FILE STATUS IS WS-FST-BI00S. 00059000
000620 DATA DIVISION. 00062000
000620 FILE SECTION. 00063000
FD BI00S-CRICKET. 00064000
01 BI00S-CRICKET-DETAILS. 00065000
02 BI00S-REGNO PIC 9(4). 00066000
02 FILLER PIC X. 00067000
02 BI00S-NAME PIC X(17). 00068000
02 FILLER PIC X(2). 00069000
02 BI00S-COUNTRY PIC X(5). 00069100
02 FILLER PIC X. 00069200
02 BI00S-STATE PIC X(13). 00069300
02 FILLER PIC X(2). 00069400
02 BI00S-SALARY PIC 9(4). 00069500
02 FILLER PIC X(31). 00069600
000700 WORKING-STORAGE SECTION. 00070000
01 WS01-VARIABLES . 00070100
05 WS-FST-BI00S PIC 9(2). 00070200
88 OPERATION-SUCCESS-BI00S VALUE 00. 00070300
88 OPERATION-EOF-BI00S VALUE 10. 00070400
002000 PROCEDURE DIVISION. 00200000
002110******************************************************************00211000
002120 0000-MAIN-PARA. 00212000
002130******************************************************************00213000
002150 PERFORM 1000-INITIALIZATION-PARA 00215000
002160 THRU 1000-INITIALIZATION-PARA-EXIT 00216000
002170 00217000
002180 PERFORM 2000-PROCESS-PARA 00218000
002190 THRU 2000-PROCESS-PARA-EXIT 00219000
002191 00219100
002192 PERFORM 9000-TERMINATION-PARA 00219200
002193 THRU 9000-TERMINATION-PARA-EXIT 00219300
002194 . 00219400
002196 0000-MAIN-PARA-EXIT. 00219600
002197 EXIT 00219700
002198 . 00219800
002201 1000-INITIALIZATION-PARA. 00220100
002216 1000-INITIALIZATION-PARA-EXIT. 00221600
002217 EXIT 00221700
002218 . 00221800
002220******************************************************************00222000
002221 2000-PROCESS-PARA. 00222100
002222******************************************************************00222200
002224 PERFORM 2100-OPEN-PARA 00222400
THRU 2100-EXIT-PARA 00222500
PERFORM 2200-READ-PARA 00222600
THRU 2200-EXIT-PARA 00222700
UNTIL OPERATION-EOF-BI00S 00222803
PERFORM 2300-CLOSE-PARA 00222900
THRU 2300-EXIT-PARA 00223000
002236 . 00223600
002238 2000-PROCESS-PARA-EXIT. 00223800
002239 EXIT 00223900
002240 . 00224000
2100-OPEN-PARA. 00225000
OPEN I-O BI00S-CRICKET 00226000
EVALUATE TRUE 00227000
WHEN OPERATION-SUCCESS-BI00S 00228000
CONTINUE 00229000
WHEN OTHER 00230000
DISPLAY WS-FST-BI00S 00240000
STOP RUN 00250000
END-EVALUATE 00251000
. 00260000
2100-EXIT-PARA. 00270000
EXIT 00280000
. 00290000
2200-READ-PARA. 00300000
READ BI00S-CRICKET 00310000
EVALUATE TRUE 00320000
WHEN OPERATION-SUCCESS-BI00S 00321000
IF BI00S-STATE = 'GUJARAT' THEN 00321108
DISPLAY '*********************' 00322001
DISPLAY BI00S-REGNO 00323000
DISPLAY BI00S-NAME 00324000
DISPLAY BI00S-COUNTRY 00325000
DISPLAY BI00S-STATE 00326000
DISPLAY BI00S-SALARY 00327000
DISPLAY '**********************' 00328001
END-IF 00328106
WHEN OPERATION-EOF-BI00S 00328200
CONTINUE 00328300
WHEN OTHER 00328400
DISPLAY WS-FST-BI00S 00328500
STOP RUN 00328600
END-EVALUATE 00328702
. 00328800
2200-EXIT-PARA. 00328900
EXIT 00329000
. 00329100
2300-CLOSE-PARA. 00329200
CLOSE BI00S-CRICKET 00329300
EVALUATE TRUE 00329400
WHEN OPERATION-SUCCESS-BI00S 00329500
DISPLAY 'CLOSED SUCCESSFULLY' 00329600
CONTINUE 00329700
WHEN OTHER 00329800
DISPLAY 'NOT CLOSED' 00329900
STOP RUN 00330000
END-EVALUATE 00330100
. 00330200
2300-EXIT-PARA. 00330300
EXIT 00330400
. 00330500
003290 9000-TERMINATION-PARA. 00330600
003900 STOP RUN 00390000
004000 . 00400000
004200 9000-TERMINATION-PARA-EXIT. 00420000
004300 EXIT 00430000
004400 . 00440000
IDENTIFICATION DIVISION. 00010000
PROGRAM-ID. FILEHAND. 00050000
AUTHOR. SRIBLOG. 00051000
DATE-WRITTEN. NOV 26, 2013. 00052000
DATE-COMPILED. NOV 26, 2013. 00053000
ENVIRONMENT DIVISION. 00054000
INPUT-OUTPUT SECTION. 00054100
FILE-CONTROL. 00055000
SELECT BI00S-CRICKET ASSIGN TO DD1 00056000
ORGANIZATION IS SEQUENTIAL 00057000
ACCESS MODE IS SEQUENTIAL 00058000
FILE STATUS IS WS-FST-BI00S. 00059000
000620 DATA DIVISION. 00062000
000620 FILE SECTION. 00063000
FD BI00S-CRICKET. 00064000
01 BI00S-CRICKET-DETAILS. 00065000
02 BI00S-REGNO PIC 9(4). 00066000
02 FILLER PIC X. 00067000
02 BI00S-NAME PIC X(17). 00068000
02 FILLER PIC X(2). 00069000
02 BI00S-COUNTRY PIC X(5). 00069100
02 FILLER PIC X. 00069200
02 BI00S-STATE PIC X(13). 00069300
02 FILLER PIC X(2). 00069400
02 BI00S-SALARY PIC 9(4). 00069500
02 FILLER PIC X(31). 00069600
000700 WORKING-STORAGE SECTION. 00070000
01 WS01-VARIABLES . 00070100
05 WS-FST-BI00S PIC 9(2). 00070200
88 OPERATION-SUCCESS-BI00S VALUE 00. 00070300
88 OPERATION-EOF-BI00S VALUE 10. 00070400
002000 PROCEDURE DIVISION. 00200000
002110******************************************************************00211000
002120 0000-MAIN-PARA. 00212000
002130******************************************************************00213000
002150 PERFORM 1000-INITIALIZATION-PARA 00215000
002160 THRU 1000-INITIALIZATION-PARA-EXIT 00216000
002170 00217000
002180 PERFORM 2000-PROCESS-PARA 00218000
002190 THRU 2000-PROCESS-PARA-EXIT 00219000
002191 00219100
002192 PERFORM 9000-TERMINATION-PARA 00219200
002193 THRU 9000-TERMINATION-PARA-EXIT 00219300
002194 . 00219400
002196 0000-MAIN-PARA-EXIT. 00219600
002197 EXIT 00219700
002198 . 00219800
002201 1000-INITIALIZATION-PARA. 00220100
002216 1000-INITIALIZATION-PARA-EXIT. 00221600
002217 EXIT 00221700
002218 . 00221800
002220******************************************************************00222000
002221 2000-PROCESS-PARA. 00222100
002222******************************************************************00222200
002224 PERFORM 2100-OPEN-PARA 00222400
THRU 2100-EXIT-PARA 00222500
PERFORM 2200-READ-PARA 00222600
THRU 2200-EXIT-PARA 00222700
UNTIL OPERATION-EOF-BI00S 00222803
PERFORM 2300-CLOSE-PARA 00222900
THRU 2300-EXIT-PARA 00223000
002236 . 00223600
002238 2000-PROCESS-PARA-EXIT. 00223800
002239 EXIT 00223900
002240 . 00224000
2100-OPEN-PARA. 00225000
OPEN I-O BI00S-CRICKET 00226000
EVALUATE TRUE 00227000
WHEN OPERATION-SUCCESS-BI00S 00228000
CONTINUE 00229000
WHEN OTHER 00230000
DISPLAY WS-FST-BI00S 00240000
STOP RUN 00250000
END-EVALUATE 00251000
. 00260000
2100-EXIT-PARA. 00270000
EXIT 00280000
. 00290000
2200-READ-PARA. 00300000
READ BI00S-CRICKET 00310000
EVALUATE TRUE 00320000
WHEN OPERATION-SUCCESS-BI00S 00321000
IF BI00S-STATE = 'GUJARAT' THEN 00321108
DISPLAY '*********************' 00322001
DISPLAY BI00S-REGNO 00323000
DISPLAY BI00S-NAME 00324000
DISPLAY BI00S-COUNTRY 00325000
DISPLAY BI00S-STATE 00326000
DISPLAY BI00S-SALARY 00327000
DISPLAY '**********************' 00328001
END-IF 00328106
WHEN OPERATION-EOF-BI00S 00328200
CONTINUE 00328300
WHEN OTHER 00328400
DISPLAY WS-FST-BI00S 00328500
STOP RUN 00328600
END-EVALUATE 00328702
. 00328800
2200-EXIT-PARA. 00328900
EXIT 00329000
. 00329100
2300-CLOSE-PARA. 00329200
CLOSE BI00S-CRICKET 00329300
EVALUATE TRUE 00329400
WHEN OPERATION-SUCCESS-BI00S 00329500
DISPLAY 'CLOSED SUCCESSFULLY' 00329600
CONTINUE 00329700
WHEN OTHER 00329800
DISPLAY 'NOT CLOSED' 00329900
STOP RUN 00330000
END-EVALUATE 00330100
. 00330200
2300-EXIT-PARA. 00330300
EXIT 00330400
. 00330500
003290 9000-TERMINATION-PARA. 00330600
003900 STOP RUN 00390000
004000 . 00400000
004200 9000-TERMINATION-PARA-EXIT. 00420000
004300 EXIT 00430000
004400 . 00440000