perm filename CMS3[T,LSP] blob sn#655247 filedate 1982-02-16 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00004 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	  /*THIS PROGRAM ASKS THE USER FOR A REGION NUMBER, USES A SUBROUTINE   REG00010
C00010 00003	DMSLIO740I EXECUTION BEGINS...
C00013 00004	 /*THIS PROGRAM ASKS THE USER FOR A REGION NUMBER, USES A SUBROUTINE
C00017 ENDMK
C⊗;
  /*THIS PROGRAM ASKS THE USER FOR A REGION NUMBER, USES A SUBROUTINE   REG00010
  TO SEARCH FOR THE RECORD IN A REGIONAL(1) FILE, AND PRINTS OUT THE    REG00020
  RECORD IF FOUND. IF A RECORD IS NOT FOUND, THE USER IS ASKED FOR      REG00030
  ANOTHER REGION NUMBER*/                                               REG00040
                                                                        REG00050
  REGIONS: PROCEDURE OPTIONS (MAIN);                                    REG00060
     DCL                                                                REG00070
        1 RECORD,                                                       REG00080
          2 ACCNO CHAR(4),                                              REG00090
          2 NTAGS FIXED BIN(15),                                        REG00100
          2 BIB←DATA(4),                                                REG00110
            3 DTAG FIXED BIN(15),                                       REG00120
            3 LENGTH FIXED BIN(15),                                     REG00130
            3 MDATA CHAR (219),                                         REG00140
        REGNUM FIXED BIN(15),/*REGION NUMBER TO BE SEARCHED*/           REG00150
        EOF BIT(1) INIT ('0'B),                                         REG00160
        CAT FILE RECORD KEYED ENVIRONMENT (REGIONAL (1)),               REG00170
        ONCODE BUILTIN,                                                 REG00180
        (SYSIN, SYSPRINT) FILE STREAM;                                  REG00190
                                                                        REG00200
        ON ENDFILE (SYSIN) EOF = '1'B;                                  REG00210
        OPEN FILE (CAT) INPUT DIRECT;                                   REG00220
                                                                        REG00230
        DO WHILE (↑EOF);                                                REG00240
           PUT SKIP EDIT ('ENTER REGION NO.') (A);                      REG00250
           GET EDIT (REGNUM) (F(3));                                    REG00260
           IF EOF THEN LEAVE;                                           REG00270
           CALL FIND (RECORD,REGNUM);/*PROCEDURE TO FIND RECORD USING   REG00280
                                      REGION NUMBER*/                   REG00290
        END;                                                            REG00300
        CLOSE FILE (CAT);                                               REG00310
        RETURN;                                                         REG00320
        ON KEY (CAT) /*CHECK TO MAKE SURE REGION NUMBER IS VALID*/      REG00330
           BEGIN;                                                       REG00340
             IF ONCODE = 51 THEN                                        REG00350
               DO;                                                      REG00360
                 PUT SKIP EDIT ('SORRY, KEY ',REGNUM,' NOT FOUND.       REG00370
                                TRY AGAIN.') (A,F(3),A);                REG00380
                 PUT SKIP EDIT ('REENTER') (A);                         REG00390
               END;                                                     REG00400
           END;                                                         REG00410
                                                                        REG00420
   /*THIS PROCEDURE USES THE GIVEN REGION NUMBER TO LOCATE THE RECORD   REG00430
   TO BE PRINTED OUT*/                                                  REG00440
                                                                        REG00450
   FIND: PROCEDURE (RECORD,REGNUM);                                     REG00460
      DCL                                                               REG00470
        REGNUM FIXED BIN(15),                                           REG00480
        1 RECORD CONNECTED,                                             REG00490
          2 ACCNO CHAR(4),                                              REG00500
          2 NTAGS FIXED BIN(15),                                        REG00510
          2 BIB←DATA(4),                                                REG00520
            3 DTAG FIXED BIN(15),                                       REG00530
            3 LENGTH FIXED BIN(15),                                     REG00540
            3 MDATA CHAR (219);                                         REG00550
                                                                        REG00560
      READ FILE (CAT) INTO (RECORD) KEY (REGNUM);                       REG00570
      PUT SKIP(1) EDIT (RECORD) (A(4),X(1),F(3),4 (SKIP,X(9),           REG00580
                        F(3),X(1),F(3),X(2),A));                        REG00590
      RETURN;                                                           REG00600
    END FIND;                                                           REG00610
  END REGIONS;                                                          REG00620

R; T=0.05/0.28 19:47:13


.λ
DMSLIO740I EXECUTION BEGINS...

ENTER REGION NO.
:
.λ
006



B006   4
         100  24  BALDERSTON, FREDERICK E.
                                                                               
                            
         245  28  MANAGING TODAY'S UNIVERSITY.
                                                                               
                            
         260  35  $ASAN FRANCISCO$BJOSSEY-BASS$C1975.
                                                                               
                            
         300  21  $AXVI, 307 P.$C24 CM.

                                                                               
                            
ENTER REGION NO.
:

.λ
083



T083   4
         100  15  TUSSMAN, JOSEPH
                                                                               
                            
         245  22  EXPERIMENT AT BERKELEY
                                                                               
                            
         260  41  $ANEW YORK$BOXFORD ULIVERSITY PRESS$C1969

                                                                               
         300  19  $AIX,139 P.$C21 AM.
                                                                               
                            
ENTER REGION NO.
:
.λ
143




IBM166I  'OLCODE'=0056  'KEY' COJDITION RAISED
   KEY SPECIFIES POSITION OUTSIDE REGIOJAL DATA SET ('ONFILE'= CAT)
   IN STATEMENT 21 AT OFFSET +0000AE IN PROCEDURE WITH ENTRY FIND

R(02000); T=0.77/1.67 19:40:01

.λ
 /*THIS PROGRAM ASKS THE USER FOR A REGION NUMBER, USES A SUBROUTINE
 TO SEARCH FOR THE RECORD IN A REGIONAL(1) FILE, AND PRINTS OUT THE
 RECORD IF FOUND. IF A RECORD IS NOT FOUND, THE USER IS ASKED FOR
 ANOTHER REGION NUMBER*/
     
 REGIONS: PROCEDURE OPTIONS (MAIN);
    DCL
       1 RECORD,
         2 ACCNO CHAR(4),
         2 NTAGS FIXED BIN(15),
         2 BIB←DATA(4),
           3 DTAG FIXED BIN(15),
           3 LENGTH FIXED BIN(15),
           3 MDATA CHAR (219),
       REGNUM FIXED BIN(15),/*REGION NUMBER TO BE SEARCHED*/
       EOF BIT(1) INIT ('0'B),
       CAT FILE RECORD KEYED ENVIRONMENT (REGIONAL (1)),
       ONCODE BUILTIN,
       (SYSIN, SYSPRINT) FILE STREAM;
   
       ON ENDFILE (SYSIN) EOF = '1'B;
       OPEN FILE (CAT) INPUT DIRECT;
   
       DO WHILE (↑EOF);
          PUT SKIP EDIT ('ENTER REGION NO.') (A);
          GET EDIT (REGNUM) (F(3));
          IF EOF THEN LEAVE;
          CALL FIND (RECORD,REGNUM);/*PROCEDURE TO FIND RECORD USING
                                     REGION NUMBER*/
       END;
       CLOSE FILE (CAT);
       RETURN;
       ON KEY (CAT) /*CHECK TO MAKE SURE REGION NUMBER IS VALID*/
          BEGIN;
∂           IF ONCODE = 56 THEN
              DO;
                PUT SKIP EDIT ('SORRY, KEY ',REGNUM,' NOT FOUND. 
                               TRY AGAIN.') (A,F(3),A);
                PUT SKIP EDIT ('REENTER') (A);
              END;
          END;
    
  /*THIS PROCEDURE USES THE GIVEN REGION NUMBER TO LOCATE THE RECORD
  TO BE PRINTED OUT*/
    
  FIND: PROCEDURE (RECORD,REGNUM);
     DCL
       REGNUM FIXED BIN(15),
       1 RECORD CONNECTED,
         2 ACCNO CHAR(4),
         2 NTAGS FIXED BIN(15),
         2 BIB←DATA(4),
           3 DTAG FIXED BIN(15),
           3 LENGTH FIXED BIN(15),
           3 MDATA CHAR (219);
    
     READ FILE (CAT) INTO (RECORD) KEY (REGNUM);
∂    PUT SKIP(1) EDIT (RECORD) (A(4),X(1),F(3),4 (SKIP,X(9),
∂                      F(3),X(1),F(3),X(2),A));
     RETURN;
   END FIND;
 END REGIONS;