Downloading LMS Libraries from Empower

If LMS libraries (e.g. patch level, corrections etc.) are downloaded from Empower, decoded (SNT) under BS2000 and copied with P.COPYPAM, the result is not an LMS library.

Procedure SNT-DECOD does not convert them correctly. SNTCOD under BS2000 always creates files with REC-FORM=VARIABLE. But the conversion programs SAMTOPAM and SAMTOLIB expect files with REC-FORM=FIXED.

This issue is handled in the following SAGSIS problems:

  • 227084

  • 231310

  • 231379

The input data set for this procedure is the unloaded file from Empower which must be correctly transferred to BS2000 using the following file attributes:

RECF=F
RECS=80
BLKS=(STD,1)

Therefore an additional step is necessary to convert REC-FORM from VARIABLE to FIXED. The following example procedure will do this.

/   "-----------------------------------------------------------------"
/   "  PROCEDURE:  P.SNTCOD                                           " 
/   "  TASK     :  DECOD (AND CONVERT IF NECESSARY) FILES UNLOADED"   "
/     "              FROM EMPOWER.                                   " 
/   "                                                                 "
/   "  CONVERSION STEP                                                "
/   "  ---------------                                                " 
/   "                                                                 "
/   "  ALL SOFTWARE AG BS2000 FILES ARE DELIVERED AS SEQUENTIAL       "
/   "  FILES. THUS A CONVERT STEP IS NECESSARY FOR LMS-LIBRARIES.     "
/   "  CURRENTLY THERE ARE EXISTING THREE DELIVERY FORMATS FOR        "
/   "  LIBRARIES (DSORG = DATASET ORGANIZATION)                       "
/   "                                                                 "
/   "        DSORG  REC-FORM    REC-SIZE                              "
/   "        -----  ----------  --------                              "
/   "  (1)   LIB   F(IXED)        4096                                "
/   "  (2)   PAM   F(IXED)        2064                                "
/   "  (3)   LMS   F(IXED)          80                                "
/   "-----------------------------------------------------------------"
/   SET-PROCEDURE-OPTIONS -                                            
/      DATA-ESCAPE-CHAR     = *STD                                     
/                                                                      
/   BEGIN-PARAMETER-DECLARATION                                        
/      DECLARE-PARAMETER  INPUT-FILE (*PROMPT)                         
/      DECLARE-PARAMETER  SNTLIB     ('SNT112.LIB')                    
/      DECLARE-PARAMETER  LMS        ('$LMS')                          
/   END-PARAMETER-DECLARATION                                          
/                                                                      
/   DECLARE-VARIABLE   FILE-NAME                                       
/   DECLARE-VARIABLE   REC-FORM                                        
/   DECLARE-VARIABLE   REC-SIZE                                        
/   DECLARE-VARIABLE   DSORG    (' ')                                  
/                                                                      
/   "-----------------------------------------------------------------"
/   "  DECOD INPUT-FILE                                               "
/   "-----------------------------------------------------------------"
/   ADD-FILE-LINK   LINK-NAME=SNTCOD, FILE-NAME=&(INPUT-FILE)          
/   WR-TEXT 'CALL PROCEDURE DECODSDF ON LIBRARY &SNTLIB'               
/   SHOW-VAR  INPUT-FILE                                               
/   START-PROG *MOD(&(SNTLIB),DECODSDF)                                
/                                                                      
/   "-----------------------------------------------------------------"
/   " GET FILE INFORMATION                                            "
/   "-----------------------------------------------------------------"
/   ADD-FILE-LINK   LINK-NAME=EDTSAM, FILE-NAME=&(INPUT-FILE), -       
/      ACCESS-METHOD=*BY-CAT, RECORD-FORMAT=*BY-CAT, -                 
/      RECORD-SIZE=*BY-CAT, BUFFER-LENGTH=*BY-CAT                      
/   MOD-JOB-SW ON=(4,5)                                                
/   START-EDT                                                          
@      READ   '/' 0.0003 R                                             
@      SYSTEM 'REMOVE-FILE-LINK EDTSAM'                                
@      ON 1 CHANGE ALL X'00' TO X'40'                                  
@      SETVAR 'REC-FORM'  = % :21-21:                                  
@      SETVAR 'REC-SIZE'  = % :29-32:                                  
@      DELETE % :13-15:                                                
@      SETVAR 'FILE-NAME' = % :6-16:                                   
@      HALT                                                            
/   MOD-JOB-SW OFF=(4,5)                                               
/   SHOW-VAR (FILE-NAME, REC-FORM, REC-SIZE)                           
/                                                                      
/   "-----------------------------------------------------------------"
/   "  CONVERT TO LMS-LIBRARY                                         "
/   "-----------------------------------------------------------------"
/   IF (REC-FORM = 'F')                                                
/                                                                      
/      IF (REC-SIZE = '4096')                                          
/        "------------------------------------------------------------"
/         DSORG = 'LIB'                                                
/        "------------------------------------------------------------"
/         SHOW-VAR DSORG                                               
/         DELETE-FILE   &(FILE-NAME), SUPPRES-ERR=DMS0533              
/         CREATE-FILE   &(FILE-NAME), SPACE=(1000,500)                 
/         ADD-FILE-LINK  -                                             
/            LINK-NAME  = PCOUT, -                                     
/            FILE-NAME  = &(FILE-NAME), -                              
/            ACC-METHOD = *UPAM, -                                     
/            BUF-LENGTH = *STD(2)                                      
/         START-PERCON                                                 
//           ASSIGN-INPUT-FILE  LINK-NAME=SNTOUT                       
//           SET-RECORD-MAPPING -                                      
//              OUTPUT-FIELDS = *FIELD -                               
//                 (INPUT-POSITION  =    5, -                          
//                  INPUT-LENGTH    = 4096, -                          
//                  OUTPUT-POSITION =    1)                            
//           END                                                       
/         START-LMS                                                    
//           REORGANIZE-LIBRARY LIBRARY=&(FILE-NAME)                   
//           END                                                       
/         WR-TEXT 'FILE &FILE-NAME CREATED'                            
/      END-IF                                                          
/                                                                      
/      IF (REC-SIZE = '2064')                                          
/        "------------------------------------------------------------"
/         DSORG = 'PAM'                                                
/        "------------------------------------------------------------"
/         SHOW-VAR DSORG                                               
/         DELETE-FILE   &(FILE-NAME), SUPPRES-ERR=DMS0533              
/         CREATE-FILE   &(FILE-NAME), SPACE=(1000,500)                 
/         ADD-FILE-LINK  -                                             
/            LINK-NAME  = PCOUT, -                                     
/            FILE-NAME  = &(FILE-NAME), -                              
/            ACC-METHOD = *UPAM, -                                     
/            BUF-LENGTH = *STD(1)                                      
/         START-PERCON                                                 
//           ASSIGN-INPUT-FILE  LINK-NAME=SNTOUT                       
//           SET-RECORD-MAPPING -                                      
//              OUTPUT-FIELDS = *FIELD -                               
//                 (INPUT-POSITION  =   21, -                          
//                  INPUT-LENGTH    = 2048, -                          
//                  OUTPUT-POSITION =    1)                            
//           END                                                       
/         START-LMS                                                    
//           REORGANIZE-LIBRARY LIBRARY=&(FILE-NAME)                   
//           END                                                       
/         WR-TEXT 'FILE &FILE-NAME CREATED'                            
/      END-IF                                                          
/                                                                      
/      IF (REC-SIZE = '80  ')                                          
/        "------------------------------------------------------------"
/         DSORG = 'LMS'                                                
/        "------------------------------------------------------------"
/         SHOW-VAR DSORG                                               
/         DELETE-FILE   &(FILE-NAME), SUPPRES-ERR=DMS0533              
/         CHANGE-FILE-LINK  LINK-NAME=SNTOUT, NEW-NAME=EDTSAM          
/         MOD-JOB-SW ON=(4,5)                                          
/         START-EDT                                                    
@            SET      0.0001                                           
@            READ     '/'                                              
@            DELETE   0.0003                                           
@            CREATE   0.0003 : 'LIB &(FILE-NAME),ANY,BOTH'             
@            SYSTEM   'REMOVE-FILE-LINK EDTSAM'                        
@            WRITE    '#&(FILE-NAME)' OVERWRITE                        
@            HALT                                                      
/         MOD-JOB-SW OFF=(5)                                           
/         MOD-JOB-SW ON=(1)                                            
/         ASSIGN-SYSDTA  #&(FILE-NAME)                                 
/         START-PROG   &(LMS)                                          
/         ASSIGN-SYSDTA  *SYSCMD                                       
/         MOD-JOB-SW OFF=(1,4)                                         
/         WR-TEXT 'FILE &FILE-NAME CREATED'                            
/      END-IF                                                          
/                                                                      
/   END-IF                                                             
/                                                                      
/   IF-BLOCK-ERROR                                                     
/   WR-TEXT 'PROCEDURE P.SNTCOD ENDED ABNORMALLY'                      
/   ELSE
/      WR-TEXT 'PROCEDURE P.SNTCOD ENDED NORMALLY'  
/   END-IF                                                             
/                                                                      
/   EXIT-PROCEDURE     

Use procedure P.SNTCOD of library SRV111.LIB which is delivered on every BS2000 tape since Nov. 4th, 2002.