Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
UNLBR.CBL
******************************************************************
IDENTIFICATION DIVISION.
******************************************************************
PROGRAM-ID. UNLBR.
AUTHOR. CLIVE CUMMINS.
INSTALLATION. TUBULARITY.
DATE-WRITTEN. JUN 17,1995.
******************************************************************
* THIS PROGRAM WILL EXTRACT A FILE FROM A LIBRARY FILE. *
******************************************************************
******************************************************************
DATA DIVISION.
******************************************************************
******************************************************************
WORKING-STORAGE SECTION.
******************************************************************
******************************************************************
01 LBRMAN-PARAMETERS.
******************************************************************
05 LBRMAN-FUNCTION PIC X COMP-X.
78 78-LBRMAN-CREATE-LBR VALUE 1.
78 78-LBRMAN-INCLUDE-FILE VALUE 2.
78 78-LBRMAN-UPDATE-LBR VALUE 3.
78 78-LBRMAN-CLOSE-LBR VALUE 4.
78 78-LBRMAN-LIST-CATALOG VALUE 5.
78 78-LBRMAN-FIRST-FILE VALUE 6.
78 78-LBRMAN-NEXT-FILE VALUE 7.
78 78-LBRMAN-DELETE-FILE VALUE 8.
78 78-LBRMAN-RENAME-FILE VALUE 9.
78 78-LBRMAN-HIDE-FILE VALUE 10.
78 78-LBRMAN-REVEAL-FILE VALUE 11.
78 78-LBRMAN-EXTRACT-FILE VALUE 12.
05 LBRMAN-FILE-NAME.
10 LBRMAN-FILE-55 PIC X(55).
10 FILLER PIC X(200).
05 LBRMAN-FILE-ATTRIBUTE PIC X COMP-X.
78 78-LBRMAN-SHOW-NORMAL VALUE 0.
78 78-LBRMAN-SHOW-HIDDEN VALUE 1.
05 LBRMAN-ATTRIBUTE-BYTE PIC X COMP-X.
78 78-LBRMAN-STANDARD VALUE 0.
78 78-LBRMAN-ENTRY-POINT VALUE 1.
78 78-LBRMAN-DELETED-ENTRY VALUE 2.
78 78-LBRMAN-HIDDEN-ENTRY VALUE 3.
05 LBRMAN-TIME-BYTE PIC X(2) COMP-X.
05 LBRMAN-DATE-BYTE PIC X(2) COMP-X.
05 LBRMAN-SIZE-BYTE PIC 9(4) COMP-X.
05 LBRMAN-ERROR-STATUS PIC X COMP-X.
78 78-LBRMAN-SUCCESSFUL VALUE 0.
78 78-LBRMAN-NO-LBR VALUE 1.
78 78-LBRMAN-EMPTY-LBR VALUE 2.
78 78-LBRMAN-INVALID-FILE VALUE 3.
78 78-LBRMAN-BAD-OPEN VALUE 4.
78 78-LBRMAN-BAD-CLOSE VALUE 5.
78 78-LBRMAN-BAD-READ VALUE 6.
78 78-LBRMAN-BAD-WRITE VALUE 7.
78 78-LBRMAN-BAD-LOAD VALUE 8.
78 78-LBRMAN-BAD-LBR-WRITE VALUE 9.
78 78-LBRMAN-NO-MATCH VALUE 10.
78 78-LBRMAN-BAD-CATALOG VALUE 255.
05 LBRMAN-NEW-FILE-NAME.
10 LBRMAN-NEW-FILE-55 PIC X(55).
10 FILLER PIC X(200).
******************************************************************
PROCEDURE DIVISION.
******************************************************************
INITIALIZE LBRMAN-PARAMETERS.
ACCEPT LBRMAN-FILE-NAME FROM COMMAND-LINE.
IF LBRMAN-FILE-NAME EQUAL SPACES
DISPLAY 'ENTER x:\path\lbrname.LBR\filename '
ACCEPT LBRMAN-FILE-NAME.
MOVE 78-LBRMAN-EXTRACT-FILE TO LBRMAN-FUNCTION.
CALL 'LBRMAN' USING LBRMAN-PARAMETERS.
IF LBRMAN-ERROR-STATUS EQUAL 78-LBRMAN-SUCCESSFUL
DISPLAY LBRMAN-FILE-NAME
DISPLAY 'HAS BEEN EXTRACTED'
ELSE
DISPLAY LBRMAN-FILE-NAME
DISPLAY 'NOT FOUND'.
GOBACK.