The Life and Times of Jim
Hi, there. I'm Jim. Welcome to my phlog!
This site was written for Las Vegas, then LouisVille. Now, it seems to be about anywhere. In these phlogs, you'll see a lot of my personal notes and pictures. I like to post my observations here to remember life and celebrate it. I'm not religious. I don't pray for good fortune. I'm ecstatically grateful for the gift of life and I think our time should be remembered and not taken for granted. I'm not a writer. I think pictures tell stories so much better than words. I love just about everything in this life, and, I guess that would have to include you. So, if you've seen me, don't be surprised if your picture is in here somewhere. Of all the critters, people are absolutely the most interesting. 
<< 12/2009 < 11/2010 Calendar 01/2011 > 12/2011 >>Sign InView Other Logs
Fri 
12/10/2010 11:01:38
 Jim  2010-People I Miss from Pennsylvania
Wed 
12/08/2010 19:50:40
 jim  Largo-XMas Displays
Wed 
12/08/2010 19:43:14
 jim  Largo Park-XMasLights
Wed 
12/08/2010 19:40:20
 jim  Largo-XMas, Jim and Becky
Wed 
12/08/2010 13:50:42
 jim  SQLCreat - Program to extract a SQL Create Table s
?SYMBOLS
?INSPECT
?SQL
?SAVE ALL
?ENV COMMON
?CONSULT $SYSTEM.SYSTEM.COBOLEX1
 IDENTIFICATION DIVISION.
 PROGRAM-ID. SQLBUILD.
 DATE-COMPILED.
 ENVIRONMENT DIVISION.
 CONFIGURATION SECTION.
 SOURCE-COMPUTER. TANDEM-16.
 OBJECT-COMPUTER. TANDEM-16.
 SPECIAL-NAMES.
     SWITCH-1 IS BATCH-SW
         ON STATUS IS RUNNING-BATCH
     FILE $SYSTEM.SYSTEM.COBOLLIB IS SYSTEM-COBOL-LIB
     FILE $0      IS SYSTEM-CONSOLE.
 INPUT-OUTPUT SECTION.
 FILE-CONTROL.
 DATA DIVISION.
 FILE SECTION.
 WORKING-STORAGE SECTION.
 EXEC SQL INCLUDE SQLCA END-EXEC.
 EXEC SQL BEGIN DECLARE SECTION END-EXEC.
 01 COLUMNS.
    02 COLUMNS-TABLENAME                PIC X(34).
    02 COLUMNS-COLNUMBER                PIC 9(4) COMP.
    02 COLUMNS-COLNAME                  PIC X(30).
    02 COLUMNS-COLCLASS                 PIC X(1).
    02 COLUMNS-DATATYPE                 PIC X(18).
    02 COLUMNS-FSDATATYPE               PIC S9(4) COMP.
    02 COLUMNS-COLSIZE                  PIC S9(4) COMP.
    02 COLUMNS-SCALE                    PIC S9(4) COMP.
    02 COLUMNS-PRECISION                PIC S9(4) COMP.
    02 COLUMNS-OFFSET                   PIC S9(4) COMP.
    02 COLUMNS-UNIQUEENTRYCOUNT         PIC S9(18) COMP.
    02 COLUMNS-SECONDHIGHVALUE.
       03 LEN                           PIC S9(4) COMP.
       03 VAL                           PIC X(20).
    02 COLUMNS-SECONDLOWVALUE.
       03 LEN                           PIC S9(4) COMP.
       03 VAL                           PIC X(20).
    02 COLUMNS-NULLALLOWED              PIC X(1).
    02 COLUMNS-DEFAULTCLASS             PIC X(1).
    02 COLUMNS-DEFAULTVALUE.
       03 LEN                           PIC S9(4) COMP.
       03 VAL                           PIC X(36).
    02 COLUMNS-PICTURETEXT.
       03 LEN                           PIC S9(4) COMP.
       03 VAL                           PIC X(64).
    02 COLUMNS-DATETIMESTARTFIELD       PIC S9(4) COMP.
    02 COLUMNS-DATETIMEENDFIELD         PIC S9(4) COMP.
    02 COLUMNS-DATETIMEQUALIFIER.
       03 LEN                           PIC S9(4) COMP.
       03 VAL                           PIC X(28).
    02 COLUMNS-UPSHIFT-FLAG             PIC X(1).
    02 COLUMNS-HEADING-FLAG             PIC X(1).
    02 COLUMNS-HEADINGTEXT.
       03 LEN                           PIC S9(4) COMP.
       03 VAL                           PIC X(132).
 01 KEYS.
    02 KEYS-INDEXNAME                   PIC X(34).
    02 KEYS-KEYSEQNUMBER                PIC 9(4) COMP.
    02 KEYS-TABLECOLNUMBER              PIC 9(4) COMP.
    02 KEYS-ORDERING                    PIC X(1).
 01 INDEXES.
    02 INDEXES-TABLENAME                PIC X(34).
    02 INDEXES-INDEXNAME                PIC X(34).
    02 INDEXES-TABLECODE                PIC 9(4) COMP.
    02 INDEXES-INDEX-COLCOUNT           PIC S9(4) COMP.
    02 INDEXES-CREATETIME               PIC S9(18) COMP.
    02 INDEXES-KEYTAG                   PIC 9(4) COMP.
    02 INDEXES-UNIQUEVALUE              PIC X(1).
    02 INDEXES-VALIDDEF                 PIC X(1).
    02 INDEXES-VALIDDATA                PIC X(1).
    02 INDEXES-INDEXLEVELS              PIC S9(4) COMP.
    02 INDEXES-ROWSIZE                  PIC S9(4) COMP.
    02 INDEXES-FILENAME                 PIC X(34).
 01 FILES-REC.
    02 FILES-FILENAME                   PIC X(34).
    02 FILES-FILETYPE                   PIC X(1).
    02 FILES-BLOCKSIZE                  PIC S9(4) COMP.
    02 FILES-PRIMARYEXT                 PIC 9(4)  COMP.
    02 FILES-SECONDARYEXT               PIC 9(4)  COMP.
    02 FILES-MAXEXTS                    PIC S9(4) COMP.
    02 FILES-LOCKLENGTH                 PIC S9(4) COMP.
    02 FILES-PARTITIONED                PIC X(1).
    02 FILES-AUDIT                      PIC X(1).
    02 FILES-DCOMPRESS                  PIC X(1).
    02 FILES-ICOMPRESS                  PIC X(1).
    02 FILES-CLEARONPURGE               PIC X(1).
    02 FILES-SERIALWRITES               PIC X(1).
    02 FILES-VERIFIEDWRITES             PIC X(1).
    02 FILES-BUFFERED                   PIC X(1).
    02 FILES-NOPURGEUNTIL               PIC S9(18) COMP.
    02 FILES-EOF                        PIC S9(9)  COMP.
    02 FILES-NONEMPTYBLOCKCOUNT         PIC S9(18) COMP.
    02 FILES-RECORDSIZE                 PIC S9(4)  COMP.
    02 FILES-AUDITCOMPRESS              PIC X(1).
 01 TABLES-REC.                        
    02 TABLES-TABLENAME                 PIC X(34).
    02 TABLES-TABLETYPE                 PIC X(2).
    02 TABLES-TABLECODE                 PIC 9(4) COMP.
    02 TABLES-COLCOUNT                  PIC S9(4) COMP.
    02 TABLES-GROUPID                   PIC 9(4) COMP.
    02 TABLES-USERID                    PIC 9(4) COMP.
    02 TABLES-CREATETIME                PIC S9(18) COMP.
    02 TABLES-REDEFTIME                 PIC S9(18) COMP.
    02 TABLES-SECURITYVECTOR            PIC X(4).
 01 PARTNS-REC.                        
    02 PARTNS-FILENAME                  PIC X(34).
    02 PARTNS-PRIMARYPARTITION          PIC X(1).
    02 PARTNS-PARTITIONNAME             PIC X(34).
    02 PARTNS-CATALOGNAME               PIC X(25).
    02 PARTNS-FIRSTKEY.                
       03 PARTNS-LEN                    PIC S9(4) COMP.
       03 PARTNS-VAL                    PIC X(3000).
 01 WS-TABLENAME                        PIC X(36) VALUE SPACES.
 01 WS-CURSOR                           PIC X(1000).
 EXEC SQL END DECLARE SECTION END-EXEC.  01 GET-COLUMNS.
    05 FILLER                PIC X(23) VALUE " SELECT                ".
    05 FILLER                PIC X(23) VALUE " C.TABLENAME          ,".
    05 FILLER                PIC X(23) VALUE " C.COLNUMBER          ,".
    05 FILLER                PIC X(23) VALUE " C.COLNAME            ,".
    05 FILLER                PIC X(23) VALUE " C.COLCLASS           ,".
    05 FILLER                PIC X(23) VALUE " C.DATATYPE           ,".
    05 FILLER                PIC X(23) VALUE " C.FSDATATYPE         ,".
    05 FILLER                PIC X(23) VALUE " C.COLSIZE            ,".
    05 FILLER                PIC X(23) VALUE " C.SCALE              ,".
    05 FILLER                PIC X(23) VALUE " C.PRECISION          ,".
    05 FILLER                PIC X(23) VALUE " C.OFFSET             ,".
    05 FILLER                PIC X(23) VALUE " C.UNIQUEENTRYCOUNT   ,".
    05 FILLER                PIC X(23) VALUE " C.SECONDHIGHVALUE    ,".
    05 FILLER                PIC X(23) VALUE " C.SECONDLOWVALUE     ,".
    05 FILLER                PIC X(23) VALUE " C.NULLALLOWED        ,".
    05 FILLER                PIC X(23) VALUE " C.DEFAULTCLASS       ,".
    05 FILLER                PIC X(23) VALUE " C.DEFAULTVALUE       ,".
    05 FILLER                PIC X(23) VALUE " C.PICTURETEXT        ,".
    05 FILLER                PIC X(23) VALUE " C.DATETIMESTARTFIELD ,".
    05 FILLER                PIC X(23) VALUE " C.DATETIMEENDFIELD   ,".
    05 FILLER                PIC X(23) VALUE " C.DATETIMEQUALIFIER  ,".
    05 FILLER                PIC X(23) VALUE " C.UPSHIFT            ,".
    05 FILLER                PIC X(23) VALUE " C.HEADING            ,".
    05 FILLER                PIC X(23) VALUE " C.HEADINGTEXT FROM    ".
    05 GET-COLUMNS-FILE      PIC X(36) VALUE "                       ".
    05 FILLER                PIC X(03) VALUE " C ".
    05 FILLER                PIC X(23) VALUE " WHERE C.TABLENAME =  '".
    05 GET-COLUMNS-TABLENAME PIC X(36) VALUE "                       ".
    05 FILLER                PIC X(23) VALUE "' ORDER BY C.TABLENAME,".
    05 FILLER                PIC X(23) VALUE "          C.COLNUMBER  ".
    05 FILLER                PIC X(23) VALUE " BROWSE ACCESS" .
 01 WS-DISPLAY                          PIC X(79).
 01 SQL-DATA.                          
     03 FIRST-FLAG                      PIC S9(4) COMP VALUE ZEROS.
     03 ERROR-INFO                      PIC S9(4) COMP VALUE ZEROS.
     03 MYSQL-ERROR                     PIC S9(4) COMP VALUE ZEROS.
        88 SQL-NOT-FOUND                               VALUE 100.
        88 SQL-COMPILE                                 VALUE -8025.
        88 SQL-SECURITY                                VALUE -8200.
        88 SQL-DUPLICATE                               VALUE -8227.
        88 SQL-NULL                                    VALUE -8423.
     03 SQLMSG-FILENUM                  PIC S9(4) COMP VALUE ZEROS.
     03 FIRST-RECORD-NUMBER             PIC S9(4) COMP VALUE ZEROS.
     03 OUTPUT-RECORDS                  PIC S9(4) COMP VALUE ZEROS.
     03 SQLMSG-BUFFER                   PIC X(400)     VALUE SPACES.
     03 MORE                            PIC X          VALUE SPACES.
     03 STATISTICS                      PIC X          VALUE "N".
     03 PROG-TERMID                     PIC X(8)       VALUE SPACES.
 77 WS-PROGID                           PIC X(8) VALUE "SQLKEY".
 77 WS-PRIKEY-COLCOUNT                  PIC S9(4) COMP VALUE ZERO.
 77 WS-MAX-KEYSEQ                       PIC S9(4) COMP VALUE ZERO.
 01 WS-KEYTAGX.                        
    05 WS-KEYTAG9                       PIC S9(4) COMP.
 01 WS-EXPANDED-DESCS.                 
    05 WS-DESC                          PIC X(4).
    05 WS-PICTURE                       PIC X(30).
    05 WS-NBR                           PIC 9(4).
    05 WS-FILETYPE                      PIC S9(4) COMP.
 01 GET-START-UP-MESSAGE.              
    05 GET-START-UP-PORTION             PIC X(8)        VALUE "STRING  ".
    05 GET-START-UP-RESULT              PIC S9(4)       VALUE ZEROS.
    05 GET-START-UP-TEXT                PIC X(100)      VALUE SPACES.
 01 WS-COLUMNS.                        
    05 WS-COLUMN                        PIC X(30)       OCCURS 100 TIMES.
 77 WS-PARTIAL-FILE-LENGTH              PIC S9(4) COMP  VALUE ZERO.
 77 WS-PARTIAL-FILE-NAME                PIC X(36)       VALUE " ".
 77 WS-EXTERNAL-FILE-LENGTH             PIC S9(4) COMP  VALUE ZERO.
 77 WS-EXTERNAL-FILE-NAME               PIC X(256)      VALUE " ".
 77 WS-INTERNAL-FILE-NAME               PIC X(256)     VALUE SPACES.
 77 X                                   PIC S9(4) COMP VALUE ZERO.
 77 WS-DEFAULT                          PIC X(38)      VALUE SPACES.
 77 WS-ERROR                            PIC S9(4) COMP VALUE ZERO.
 77 WS-CATALOG-NAME                     PIC X(38)      VALUE SPACES.
 77 WS-CATALOG-SUBVOL                   PIC X(38)      VALUE SPACES.
 77 WS-FILENAME                         PIC X(38)      VALUE SPACES.
 77 WS-FINQ-CATALOG                     PIC S9(4) COMP VALUE 14.
 77 WS-FINQ-ITEMS                       PIC S9(4) COMP VALUE 1.
 77 WS-FINQ-LENGTH                      PIC S9(4) COMP VALUE 36.
 77 WS-COMMA                            PIC X          VALUE SPACES.
 77 WS-PRECISION                        PIC 9(4).
 77 WS-SCALE                            PIC 9(4).
 
********************
 PROCEDURE DIVISION.
********************
 0000-STARTUP SECTION.
     MOVE ZEROS              TO GET-START-UP-RESULT.
     ENTER "GETSTARTUPTEXT" OF SYSTEM-COBOL-LIB
           USING GET-START-UP-PORTION
                 GET-START-UP-TEXT
          GIVING GET-START-UP-RESULT.
      IF GET-START-UP-RESULT = 0
         DISPLAY "--------------------------------------------------"
         DISPLAY "                SQLBUILD SYNTAX                   "
         DISPLAY "--------------------------------------------------"
         DISPLAY "   SYNTAX IS:                                     "
         DISPLAY "   SQLBUILD TableLocation                         "
         DISPLAY "                                                  "
         DISPLAY "Example: SQLBUILD/out $S.#SQLBUILD/CFFILEX.CFADDR "
         DISPLAY "                                                  "
         DISPLAY " This program displays the keys of a given table  "
         DISPLAY "                                                  "
         DISPLAY " The TableLocation does not accept define names   "
         DISPLAY " and should at the minimum, specify the subvolume "
         DISPLAY " of the table.                                    "
         DISPLAY "--------------------------------------------------"
         STOP RUN.
      INSPECT GET-START-UP-TEXT REPLACING ALL "," BY SPACE
      UNSTRING GET-START-UP-TEXT DELIMITED BY SPACE
                                     INTO WS-TABLENAME.
      MOVE WS-TABLENAME                TO WS-PARTIAL-FILE-NAME.
      MOVE  255                        TO WS-EXTERNAL-FILE-LENGTH.
      ENTER  "FILENAME_RESOLVE_" USING WS-PARTIAL-FILE-NAME
                                          WS-EXTERNAL-FILE-NAME
                                          WS-EXTERNAL-FILE-LENGTH
                                   GIVING WS-ERROR.
      IF WS-ERROR NOT = 0
         DISPLAY "AN INVALID FILE NAME WAS ENTERED"
         STOP RUN.
      MOVE WS-EXTERNAL-FILE-NAME       TO WS-TABLENAME.
*---- GET THE CATALOG'S NAME
      ENTER TAL "FNAMEEXPAND"       USING WS-EXTERNAL-FILE-NAME
                                          WS-INTERNAL-FILE-NAME
                                          WS-DEFAULT
                                   GIVING WS-ERROR.
      ENTER TAL "FILEINQUIRE"       USING OMITTED
                                          WS-INTERNAL-FILE-NAME
                                          WS-FINQ-CATALOG
                                          WS-FINQ-ITEMS
                                          WS-CATALOG-NAME
                                          WS-FINQ-LENGTH
                                          OMITTED
                                          WS-ERROR.
     MOVE SPACES                       TO WS-CATALOG-SUBVOL.
     ENTER TAL "FNAMECOLLAPSE"      USING WS-CATALOG-NAME
                                          WS-CATALOG-SUBVOL.
      INITIALIZE COLUMNS, KEYS, INDEXES.       PERFORM B100-GET-COLUMNS.
      PERFORM B200-GET-PARTS.
      DISPLAY ";".
      PERFORM B300-GET-INDEXES.
      STOP RUN.
*************************************
 B100-GET-COLUMNS            SECTION.
*************************************
      DISPLAY "CREATE TABLE " WS-TABLENAME.
      DISPLAY "(".
*---- Set up the Columns WS area
      MOVE WS-TABLENAME                TO COLUMNS-TABLENAME.
      STRING WS-CATALOG-SUBVOL            DELIMITED BY SPACES
            ".COLUMNS"                    DELIMITED BY SIZE
                                     INTO GET-COLUMNS-FILE
      MOVE COLUMNS-TABLENAME           TO GET-COLUMNS-TABLENAME.
      MOVE GET-COLUMNS                 TO WS-CURSOR.
*---- Prepare the cursor
      EXEC SQL PREPARE WS_CURSOR FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING WS-CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_TABLE_COLUMNS CURSOR FOR WS_CURSOR END-EXEC.       EXEC SQL OPEN  GET_TABLE_COLUMNS END-EXEC.
      INITIALIZE WS-COLUMNS.
 B100-LOOP.
      INITIALIZE COLUMNS.
      EXEC SQL FETCH GET_TABLE_COLUMNS INTO
                 :COLUMNS-TABLENAME          ,
                 :COLUMNS-COLNUMBER          ,
                 :COLUMNS-COLNAME            ,
                 :COLUMNS-COLCLASS           ,
                 :COLUMNS-DATATYPE           ,
                 :COLUMNS-FSDATATYPE         ,
                 :COLUMNS-COLSIZE            ,
                 :COLUMNS-SCALE              ,
                 :COLUMNS-PRECISION          ,
                 :COLUMNS-OFFSET             ,
                 :COLUMNS-UNIQUEENTRYCOUNT   ,
                 :COLUMNS-SECONDHIGHVALUE    ,
                 :COLUMNS-SECONDLOWVALUE     ,
                 :COLUMNS-NULLALLOWED        ,
                 :COLUMNS-DEFAULTCLASS       ,
                 :COLUMNS-DEFAULTVALUE       ,
                 :COLUMNS-PICTURETEXT        ,
                 :COLUMNS-DATETIMESTARTFIELD ,
                 :COLUMNS-DATETIMEENDFIELD   ,
                 :COLUMNS-DATETIMEQUALIFIER  ,
                 :COLUMNS-UPSHIFT-FLAG       ,
                 :COLUMNS-HEADING-FLAG       ,
                 :COLUMNS-HEADINGTEXT
      END-EXEC.
      IF SQLCODE NOT = 0
         GO TO B100-END.
      ADD 1, COLUMNS-COLNUMBER     GIVING X.
      MOVE COLUMNS-COLNAME             TO WS-COLUMN (X).
      MOVE SPACES                      TO WS-PICTURE.
      IF LEN OF COLUMNS-PICTURETEXT > 0
         MOVE VAL OF COLUMNS-PICTURETEXT (1:LEN OF COLUMNS-PICTURETEXT)
                                       TO WS-PICTURE
      ELSE
         IF COLUMNS-PRECISION > 0
            MOVE COLUMNS-PRECISION TO WS-PRECISION
            MOVE COLUMNS-SCALE     TO WS-SCALE
            STRING COLUMNS-DATATYPE  DELIMITED BY "   "
                   "("               DELIMITED BY SIZE
                   WS-PRECISION      DELIMITED BY SIZE
                   ","               DELIMITED BY SIZE
                   WS-SCALE          DELIMITED BY SIZE
                   ")"               DELIMITED BY SIZE
                                INTO WS-PICTURE
         ELSE
            MOVE COLUMNS-COLSIZE          TO WS-NBR
            STRING COLUMNS-DATATYPE  DELIMITED BY " "
                   " ("              DELIMITED BY SIZE
                   WS-NBR            DELIMITED BY SIZE
                   ")"               DELIMITED BY SIZE
                                     INTO WS-PICTURE
      .
      IF LEN      OF COLUMNS-DATETIMEQUALIFIER > 0
         MOVE SPACES TO WS-PICTURE
         STRING "DATETIME "
          VAL OF COLUMNS-DATETIMEQUALIFIER (1:LEN OF COLUMNS-DATETIMEQUALIFIER)
                DELIMITED BY SIZE
                                     INTO WS-PICTURE.
   
      DISPLAY "   " COLUMNS-COLNAME "   " WS-PICTURE.
      IF COLUMNS-UPSHIFT-FLAG = "Y"
         DISPLAY "                                    "
                 "UPSHIFT".
      IF COLUMNS-DEFAULTCLASS = "S"
         DISPLAY "                                    "
                 "DEFAULT SYSTEM".
      IF COLUMNS-NULLALLOWED = "N"
         DISPLAY "                                    "
                 "NOT NULL".
      IF COLUMNS-HEADING-FLAG = "Y"
         DISPLAY "                                    "
                 "HEADING "
                 QUOTE
                 VAL OF COLUMNS-HEADINGTEXT (1:LEN OF COLUMNS-HEADINGTEXT)
                 QUOTE
                 ","
      ELSE
         DISPLAY "   ,".
      GO TO B100-LOOP.
 B100-END.
      MOVE WS-TABLENAME      TO INDEXES-TABLENAME.
      PERFORM B110-GET-PRIMARY-KEY.
 B100-EXIT. EXIT.
*===================================*
 B110-GET-PRIMARY-KEY        SECTION.
*===================================*
 B110-INIT.
      DISPLAY "   PRIMARY KEY"
      MOVE "("                         TO WS-COMMA.
      MOVE SPACES                      TO WS-CURSOR.
      STRING
         "SELECT "          DELIMITED BY SIZE
         " TABLENAME  ,"    DELIMITED BY SIZE
         " INDEXNAME  ,"    DELIMITED BY SIZE
         " TABLECODE  ,"    DELIMITED BY SIZE
         " COLCOUNT   ,"    DELIMITED BY SIZE
         " CREATETIME ,"    DELIMITED BY SIZE
         " KEYTAG     ,"    DELIMITED BY SIZE
         " UNIQUEVALUE,"    DELIMITED BY SIZE
         " VALIDDEF   ,"    DELIMITED BY SIZE
         " VALIDDATA  ,"    DELIMITED BY SIZE
         " INDEXLEVELS,"    DELIMITED BY SIZE
         " ROWSIZE,    "    DELIMITED BY SIZE
         " FILENAME    "    DELIMITED BY SIZE
         "  FROM "          DELIMITED BY SIZE
         WS-CATALOG-SUBVOL  DELIMITED BY SPACES
         ".INDEXES "        DELIMITED BY SIZE
         " WHERE TABLENAME = '" DELIMITED BY SIZE
           WS-TABLENAME     DELIMITED BY SPACES
         "' AND KEYTAG = 0" DELIMITED BY SIZE
         "  BROWSE ACCESS"  DELIMITED BY SIZE
                                     INTO WS-CURSOR.
      EXEC SQL PREPARE WS_CURSOR2 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING INDEX CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_INDEX_CURSOR  CURSOR FOR WS_CURSOR2 END-EXEC.
      EXEC SQL OPEN  GET_INDEX_CURSOR  END-EXEC.
      EXEC SQL FETCH GET_INDEX_CURSOR
            INTO :INDEXES-TABLENAME      ,
                 :INDEXES-INDEXNAME      ,
                 :INDEXES-TABLECODE      ,
                 :INDEXES-INDEX-COLCOUNT ,
                 :INDEXES-CREATETIME     ,
                 :INDEXES-KEYTAG         ,
                 :INDEXES-UNIQUEVALUE    ,
                 :INDEXES-VALIDDEF       ,
                 :INDEXES-VALIDDATA      ,
                 :INDEXES-INDEXLEVELS    ,
                 :INDEXES-ROWSIZE        ,
                 :INDEXES-FILENAME
      END-EXEC.
      IF SQLCODE NOT = 0
         GO TO B110-EXIT.
      MOVE INDEXES-INDEX-COLCOUNT      TO WS-PRIKEY-COLCOUNT.
      MOVE WS-PRIKEY-COLCOUNT          TO WS-MAX-KEYSEQ.
      MOVE INDEXES-KEYTAG              TO WS-KEYTAG9.
      MOVE INDEXES-INDEXNAME           TO KEYS-INDEXNAME.
      MOVE SPACES                      TO WS-CURSOR.
      STRING
          "SELECT INDEXNAME,KEYSEQNUMBER ,"       DELIMITED BY SIZE
                 "TABLECOLNUMBER, ORDERING FROM " DELIMITED BY SIZE
                  WS-CATALOG-SUBVOL               DELIMITED BY SPACES
                  ".KEYS "                        DELIMITED BY SIZE
                  "WHERE  INDEXNAME = '"          DELIMITED BY SIZE
                   KEYS-INDEXNAME                 DELIMITED BY SPACES
                  "' ORDER BY KEYSEQNUMBER "      DELIMITED BY SIZE
                  "BROWSE ACCESS"                 DELIMITED BY SIZE
                                         INTO WS-CURSOR.

      EXEC SQL PREPARE WS_CURSOR3 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING INDEX CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_KEYS_CURSOR  CURSOR FOR WS_CURSOR3 END-EXEC.
      EXEC SQL OPEN    GET_KEYS_CURSOR END-EXEC.
 B110-LOOP.
      EXEC SQL FETCH GET_KEYS_CURSOR INTO
                 :KEYS-INDEXNAME,
                 :KEYS-KEYSEQNUMBER,
                 :KEYS-TABLECOLNUMBER,
                 :KEYS-ORDERING
      END-EXEC.
      IF SQLCODE NOT = 0
      OR KEYS-KEYSEQNUMBER NOT < WS-MAX-KEYSEQ
         EXEC SQL CLOSE GET_KEYS_CURSOR END-EXEC
         GO TO B110-END.
      INITIALIZE COLUMNS.
      MOVE INDEXES-TABLENAME           TO COLUMNS-TABLENAME.
      ADD 1 TO KEYS-TABLECOLNUMBER GIVING X.
      IF KEYS-ORDERING = "A" MOVE "ASC " TO WS-DESC ELSE
      IF KEYS-ORDERING = "D" MOVE "DESC" TO WS-DESC ELSE
                             MOVE "____" TO WS-DESC.
      DISPLAY "   " WS-COMMA "  " WS-COLUMN (X)  WS-DESC.
      MOVE ","                         TO WS-COMMA.
      GO TO B110-LOOP.
 B110-END.
      DISPLAY "   )".
      DISPLAY ")".
      MOVE SPACES                      TO WS-CURSOR.
      STRING
          "SELECT FILETYPE, "     DELIMITED BY SIZE
                 "BLOCKSIZE, "    DELIMITED BY SIZE
                 "MAXEXTS,   "    DELIMITED BY SIZE
                 "PRIMARYEXT, "   DELIMITED BY SIZE
                 "SECONDARYEXT  " DELIMITED BY SIZE
                 "FROM "          DELIMITED BY SIZE
                  WS-CATALOG-SUBVOL    DELIMITED BY SPACES
                  ".FILES "            DELIMITED BY SIZE
                  "WHERE  FILENAME = '"          DELIMITED BY SIZE
                   WS-TABLENAME        DELIMITED BY SPACES
                  "' BROWSE ACCESS"    DELIMITED BY SIZE
                                     INTO WS-CURSOR.
      EXEC SQL PREPARE WS_CURSOR4 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING INDEX CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_FILES_CURSOR CURSOR FOR WS_CURSOR4 END-EXEC.
      EXEC SQL OPEN    GET_FILES_CURSOR END-EXEC.
      EXEC SQL FETCH   GET_FILES_CURSOR INTO
                       :FILES-FILETYPE  ,
                       :FILES-BLOCKSIZE ,
                       :FILES-MAXEXTS   ,
                       :FILES-PRIMARYEXT,
                       :FILES-SECONDARYEXT
      END-EXEC.
      MOVE SPACES                      TO WS-CURSOR.
      STRING
          "SELECT SECURITYVECTOR " DELIMITED BY SIZE
                 "FROM "           DELIMITED BY SIZE
                  WS-CATALOG-SUBVOL    DELIMITED BY SPACES
                  ".TABLES "           DELIMITED BY SIZE
                  "WHERE  TABLENAME = '" DELIMITED BY SIZE
                   WS-TABLENAME        DELIMITED BY SPACES
                  "' BROWSE ACCESS"    DELIMITED BY SIZE
                                     INTO WS-CURSOR.
      EXEC SQL PREPARE WS_CURSOR5 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING INDEX CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_TABLES_CURSOR CURSOR FOR WS_CURSOR5 END-EXEC.
      EXEC SQL OPEN    GET_TABLES_CURSOR END-EXEC.
      EXEC SQL FETCH   GET_TABLES_CURSOR INTO
           :TABLES-SECURITYVECTOR
      END-EXEC.
      DISPLAY "CATALOG " WS-CATALOG-SUBVOL.
      IF FILES-FILETYPE = "K"
         DISPLAY "ORGANIZATION KEY SEQUENCED"
      ELSE
         DISPLAY "ORGANIZATION RELATIVE     ".
      DISPLAY "SECURE " QUOTE TABLES-SECURITYVECTOR QUOTE.
      DISPLAY "EXTENT (" FILES-PRIMARYEXT "," FILES-SECONDARYEXT ")".
      DISPLAY "MAXEXTENTS " FILES-MAXEXTS.
 B110-EXIT. EXIT.
*************************************
 B200-GET-PARTS              SECTION.
*************************************
 B200-INIT.
      INITIALIZE PARTNS-REC.
      MOVE SPACES                    TO WS-CURSOR.
      STRING
         "SELECT "                     DELIMITED BY SIZE
         " P.PARTITIONNAME,"           DELIMITED BY SIZE
         " P.FIRSTKEY,"                DELIMITED BY SIZE
         " F.PRIMARYEXT,"              DELIMITED BY SIZE
         " F.SECONDARYEXT,"           DELIMITED BY SIZE
         " F.MAXEXTS"                  DELIMITED BY SIZE
         "  FROM "                     DELIMITED BY SIZE
         WS-CATALOG-SUBVOL             DELIMITED BY SPACES
         ".PARTNS P, "                 DELIMITED BY SIZE
         WS-CATALOG-SUBVOL             DELIMITED BY SPACES
         ".FILES F"                    DELIMITED BY SIZE
         " WHERE P.FILENAME = '"       DELIMITED BY SIZE
           WS-TABLENAME                DELIMITED BY SPACES
         "' AND P.PRIMARYPARTITION = 'N'" DELIMITED BY SIZE
         "  AND F.FILENAME = P.PARTITIONNAME" DELIMITED BY SIZE
         "  BROWSE ACCESS"             DELIMITED BY SIZE
                                     INTO WS-CURSOR.
      EXEC SQL PREPARE WS_CURSOR6 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING PARTNS CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_PARTNS_CURSOR CURSOR FOR WS_CURSOR6 END-EXEC.
      EXEC SQL OPEN    GET_PARTNS_CURSOR END-EXEC.
      EXEC SQL FETCH   GET_PARTNS_CURSOR INTO
           :PARTNS-PARTITIONNAME,
           :PARTNS-FIRSTKEY,
           :FILES-PRIMARYEXT,
           :FILES-SECONDARYEXT,
           :FILES-MAXEXTS
      END-EXEC.
      IF SQLCODE NOT = ZERO
         EXEC SQL CLOSE GET_PARTNS_CURSOR END-EXEC
         GO TO B200-EXIT.
 B200-LOOP.
      DISPLAY " ".
      DISPLAY "PARTITION".
      DISPLAY "   (".
      DISPLAY "   " PARTNS-PARTITIONNAME.
      DISPLAY "   CATALOG " WS-CATALOG-SUBVOL.
      DISPLAY "   EXTENT (" FILES-PRIMARYEXT "," FILES-SECONDARYEXT ")".
      DISPLAY "   MAXEXTENTS "  FILES-MAXEXTS.
      DISPLAY "   FIRST KEY " PARTNS-VAL (1:PARTNS-LEN).
      DISPLAY "   )".
      EXEC SQL FETCH   GET_PARTNS_CURSOR INTO
           :PARTNS-PARTITIONNAME,
           :PARTNS-FIRSTKEY,
           :FILES-PRIMARYEXT,
           :FILES-SECONDARYEXT,
           :FILES-MAXEXTS
      END-EXEC.
      IF SQLCODE = 0
         GO TO B200-LOOP.
 B200-END.
      EXEC SQL CLOSE GET_PARTNS_CURSOR END-EXEC.
 B200-EXIT. EXIT.
*************************************
 B300-GET-INDEXES            SECTION.
*************************************
       MOVE SPACES                     TO WS-CURSOR.
       STRING
         "SELECT " DELIMITED BY SIZE
         " TABLENAME,"          DELIMITED BY SIZE
         " INDEXNAME,"          DELIMITED BY SIZE
         " TABLECODE,"          DELIMITED BY SIZE
         " COLCOUNT,"           DELIMITED BY SIZE
         " CREATETIME,"         DELIMITED BY SIZE
         " KEYTAG,"             DELIMITED BY SIZE
         " UNIQUEVALUE,"        DELIMITED BY SIZE
         " VALIDDEF,"           DELIMITED BY SIZE
         " VALIDDATA,"          DELIMITED BY SIZE
         " INDEXLEVELS,"        DELIMITED BY SIZE
         " ROWSIZE,"            DELIMITED BY SIZE
         " FILENAME"            DELIMITED BY SIZE
         " FROM "               DELIMITED BY SIZE
         WS-CATALOG-SUBVOL      DELIMITED BY SPACES
         ".INDEXES"             DELIMITED BY SIZE
         " WHERE TABLENAME = '" DELIMITED BY SIZE
         WS-TABLENAME           DELIMITED BY SPACES
         "' AND KEYTAG > 0 "    DELIMITED BY SIZE
         " ORDER BY KEYTAG"     DELIMITED BY SIZE
         " BROWSE ACCESS"       DELIMITED BY SIZE
                                     INTO WS-CURSOR.
      EXEC SQL PREPARE WS_CURSOR7 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING INDEX CURSOR"
         STOP RUN.
      EXEC SQL DECLARE GET_INDEXES_CURSOR CURSOR FOR WS_CURSOR7 END-EXEC.
      EXEC SQL OPEN    GET_INDEXES_CURSOR END-EXEC.
 B300-LOOP.
      EXEC SQL FETCH GET_INDEXES_CURSOR INTO
                 :INDEXES-TABLENAME      ,
                 :INDEXES-INDEXNAME      ,
                 :INDEXES-TABLECODE      ,
                 :INDEXES-INDEX-COLCOUNT ,
                 :INDEXES-CREATETIME     ,
                 :INDEXES-KEYTAG         ,
                 :INDEXES-UNIQUEVALUE    ,
                 :INDEXES-VALIDDEF       ,
                 :INDEXES-VALIDDATA      ,
                 :INDEXES-INDEXLEVELS    ,
                 :INDEXES-ROWSIZE        ,
                 :INDEXES-FILENAME
      END-EXEC.
      IF SQLCODE NOT = ZEROS
         EXEC SQL CLOSE GET_INDEXES_CURSOR END-EXEC
         GO TO B300-END.
      MOVE SPACES                      TO WS-DISPLAY.
      IF INDEXES-UNIQUEVALUE = "Y"
         STRING "CREATE "                 DELIMITED BY SIZE
                "UNIQUE"                  DELIMITED BY SPACES
                " INDEX "                 DELIMITED BY SIZE
                INDEXES-INDEXNAME         DELIMITED BY SPACES
                " ON "                    DELIMITED BY SIZE
                WS-TABLENAME              DELIMITED BY SPACES
                                     INTO WS-DISPLAY
         MOVE INDEXES-INDEX-COLCOUNT   TO WS-MAX-KEYSEQ
      ELSE
         STRING "CREATE INDEX "           DELIMITED BY SIZE
                INDEXES-INDEXNAME         DELIMITED BY SPACES
                " ON "                    DELIMITED BY SIZE
                WS-TABLENAME              DELIMITED BY SPACES
                                     INTO WS-DISPLAY
         COMPUTE WS-MAX-KEYSEQ = INDEXES-INDEX-COLCOUNT - WS-PRIKEY-COLCOUNT.
      DISPLAY WS-DISPLAY.

      MOVE INDEXES-INDEXNAME           TO KEYS-INDEXNAME
      MOVE SPACES                      TO WS-CURSOR.
      STRING
         " SELECT"                        DELIMITED BY SIZE
         "  INDEXNAME,"                   DELIMITED BY SIZE
         "  KEYSEQNUMBER,"                DELIMITED BY SIZE
         "  TABLECOLNUMBER,"              DELIMITED BY SIZE
         "  ORDERING"                     DELIMITED BY SIZE
         "  FROM "                        DELIMITED BY SIZE
         WS-CATALOG-SUBVOL                DELIMITED BY SPACES
         ".KEYS WHERE  INDEXNAME = '"     DELIMITED BY SIZE
         KEYS-INDEXNAME                   DELIMITED BY SPACES
         "' AND TABLECOLNUMBER < 9999"    DELIMITED BY SIZE
         " ORDER BY KEYSEQNUMBER"         DELIMITED BY SIZE
         " BROWSE ACCESS"                 DELIMITED BY SIZE
                                     INTO WS-CURSOR.
      EXEC SQL PREPARE WS_CURSOR8 FROM :WS-CURSOR END-EXEC.
      IF SQLCODE < 0
         DISPLAY "FATAL ERROR PREPARING KEYS2 CURSOR"
         STOP RUN.
      MOVE "("                         TO WS-COMMA.
      EXEC SQL DECLARE GET_KEYS2_CURSOR CURSOR FOR WS_CURSOR8 END-EXEC.
      EXEC SQL OPEN    GET_KEYS2_CURSOR END-EXEC.
 B300-GET-KEYS-COLUMNS.
      EXEC SQL FETCH GET_KEYS2_CURSOR INTO
                 :KEYS-INDEXNAME,
                 :KEYS-KEYSEQNUMBER,
                 :KEYS-TABLECOLNUMBER,
                 :KEYS-ORDERING
      END-EXEC.
      IF SQLCODE NOT = 0
      OR KEYS-KEYSEQNUMBER NOT < WS-MAX-KEYSEQ
         EXEC SQL CLOSE GET_KEYS2_CURSOR END-EXEC
         GO TO  B300-GET-KEYS-COLUMNS-END.
      IF KEYS-ORDERING = "A" MOVE "ASC " TO WS-DESC ELSE
      IF KEYS-ORDERING = "D" MOVE "DESC" TO WS-DESC ELSE
                             MOVE "____" TO WS-DESC.
      ADD 1, KEYS-TABLECOLNUMBER GIVING X.
      DISPLAY "   " WS-COMMA " " WS-COLUMN (X) "    " WS-DESC.
      MOVE ","                         TO WS-COMMA.
      GO TO B300-GET-KEYS-COLUMNS.
 B300-GET-KEYS-COLUMNS-END.
      DISPLAY "   )".
      DISPLAY "   CATALOG " WS-CATALOG-SUBVOL.
      MOVE INDEXES-KEYTAG                TO WS-KEYTAG9.
      DISPLAY "   KEYTAG " QUOTE WS-KEYTAGX QUOTE.
      ENTER TAL "FNAMECOLLAPSE"       USING INDEXES-INDEXNAME
                                            WS-FILENAME.
      ENTER TAL "FILEINFO"            USING OMITTED
                                            WS-ERROR
                                            WS-FILENAME
                                            OMITTED
                                            OMITTED
                                            FILES-PRIMARYEXT
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            FILES-SECONDARYEXT
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            TABLES-SECURITYVECTOR
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            WS-FILETYPE
                                            FILES-MAXEXTS
                                            OMITTED
                                            OMITTED
                                            OMITTED
                                            OMITTED.
      DISPLAY "   EXTENT (" FILES-PRIMARYEXT "," FILES-SECONDARYEXT ")"
*     DISPLAY "   SECURE " QUOTE TABLES-SECURITYVECTOR QUOTE.
      DISPLAY "   MAXEXTENTS " FILES-MAXEXTS.
      DISPLAY ";".
      GO TO B300-LOOP.
 B300-END.
 B300-EXIT. EXIT.
*
*FILE-IO-SECTION SECTION.
*     COPY DATE-PROCESSING            OF \CP1.$SYSTEM.LIB.COBLIB.

Wed 
12/08/2010 12:49:17
 jim  WestPark, FL-Brians House
Wed 
12/08/2010 12:14:27
 jim  Brians Team Party
Sun 
12/05/2010 18:09:23
 jim  Cracker Barrel Tottler
Sun 
12/05/2010 18:09:14
 jim  Cracker Barrel - Food
Sun 
12/05/2010 18:07:44
 jim  Cracker Barrel
Fri 
12/03/2010 22:50:24
 jim  St Petersburg
Fri 
12/03/2010 22:40:26
 jim  Pinellas Park - Christmas Display
Fri 
12/03/2010 20:59:08
 jim  StPetersburg - 1st Friday Concert
Fri 
12/03/2010 19:54:56
 jim  StPetersburg - Oakdale Christmas House
Mon 
11/29/2010 12:04:05
 jim  Tampa - International Mall - IceCastle
Tue 
11/23/2010 15:04:02
 jim  StPetersburg Sawgrass Lake Park
Mon 
11/22/2010 19:37:46
 jim  SunsetBeach - Caddys Street
Mon 
11/22/2010 19:18:42
 jim  SunsetBeach Caddys-Snowman
Mon 
11/22/2010 18:41:30
 jim  SunsetBeach-Sunset
Mon 
11/22/2010 18:06:30
 jim  Caddys on the Beach - People
Mon 
11/22/2010 18:05:58
 jim  Caddys on the Beach - Jim and Becky
Mon 
11/22/2010 18:05:54
 jim  Sunset Beach - Caddys on the Beach
Wed 
11/10/2010 17:52:30
 jim  BuschGardens-ScareCrow
Wed 
11/10/2010 16:53:08
 jim  BuschGardens-Flamingos

<< 12/2009 < 11/2010 Calendar 01/2011 > 12/2011 >>Sign InView Other Logs