I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressHello Richard,
It may be that Server Express 5.1 is requiring a more exacting description of the file attributes in the program than Object COBOL did. Please try the following command against the data file returning the error:
rebuild myfile -f
The rebuild utility will create a report showing information about the file, and indicating whether the file is considered valid or not. When you look at the generated report, it will show the indexes that are defined in the file. Then, check the program to see if all of the indexes are mentioned in the SELECT clause for the file.
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressAlso make sure that you are using the same compiler directives and file handler configuration options that you used previously.
In particular, directives like IBMCOMP can change how comp data is stored and change the expected record length of the file.
Thanks.
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressThanks for your reply. I tried rebuild myfile -f as you suggested. 
There is only 1 index. I have checked this is correctly specified in the program. 
Although the recording mode is variable, the minimum and maximum record size is 129. 
rebuild says the "File is OK".
Incidentally it has compression set:
$set datacompress(1)
$set keycompress(6)
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressThanks Chris. There are a lot of compiler directives! I've just looked through some of them.
The records each have 2 PIC 9(8) COMP items which are aligned on 4 byte boundaries.  
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressThe important item here is that the same directives be used in Server Express 5.1 that were used in OCDS including those for file and key compression.
Are you using the same compiler directives in both?
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressThank you Chris. 
Yes the compiler directives are the same. This is my compile script:
echo compile and generate ALL cobol into LIVE directory                        
trap 'exit' 15
COBDIR=/opt/microfocus/cobol
export COBDIR
COBIDY=/source/cobol/idy
export COBIDY
COBCPY=/source/copy
export COBCPY
LD_LIBRARY_PATH=/$COBDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
PATH=/$COBDIR/bin:$PATH
export PATH
TERM=vt220
export TERM
COBSW=-A
umask 0000
cd /source/cobol
rm /source/live/*.gnt
rm /source/live/*.S
cob -C "verbose noanim confirm" /source/cobol/*.cbl
cd /source/live
cob -A -N "nobound" -u  /source/cobol/*.int
copy /source/cobol/*.S /source/live
chmod  w x /source/live/*.S
chmod  w x /source/live/*.gnt
exit
Within the Cobol are the two lines
$set datacompress(1)
$set keycompress(6)
The cobol source, copy and the indexed data file were copied onto the test server from the live one with no modification. I also copied over the above script, and changed COBDIR and LD_LIBRARY_PATH to specify the new paths. I added -A to the second cob statement. The program was then compiled using the script on the test server. 
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressCan you show me what the select and FD record descriptions look like for this file?
What makes you think that the problem is caused by records that are not aligned on 4 byte boundaries?
Are you getting an error to that effect?
If you look at the record in the debugger what is the record length that it shows on the 01 level?
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpress       file-control.
      $set datacompress(1)
      $set keycompress(6)
           select f902 assign f902-filename
               organization indexed
               access dynamic
               lock mode is manual
               record key f902-key
               file status is w-status.
       data division.
       file section.
       fd  f902.
       01   f902-record.                                                       
         03  f902-key.
           05  f902-access.
             07  f902-access-key                 pic x(6).
             07  f902-sequence                   pic x(2).
           05  f902-program.
             07  f902-program-char pic x occurs 8.
         03  f902-udatetime.
           05  f902-udate                        pic 9(8) comp.
           05  f902-utime                        pic 9(8) comp.
         03  f902-switches                       pic x(21).
         03  f902-prompt                         pic x(8).
         03  f902-desc                           pic x(76).
When I first tried to run the program, status 39 was returned when it tried to open the file (i-o).
I looked up status 39 - "A conflict has been detected between the fixed file attributes and the attributes specified for that file in the program."
In File Handling Reference: Types of indexed files, physical characteristics it says that IDXFORMAT"3" has a data record alignment of 4 bytes.
I used rebuild to confirm that the file was IDXFORMAT"3" and that the record length was 129 bytes.
I initially encountered the problem on about 6 files on our test system, and tried padding out the records with fillers to a multiple of 4 bytes. (I had to do this on the old system as I couldn't get the files to open on the test one). I modified the size of the record in the fd sections of the programs and I could then get them to run. Unfortunately the next file I encountered which gave status 39 has hundreds of instances. It has a record length of 50.
I couldn't see any compiler directives which would allow files that have records not aligned on 4 bytes to be opened. But as the files open OK on our Object Cobol 4.1 system I wondered if there was some switch for backwards compatibility. If not, I will just have to get on with rebuilding all the files, and until that's done I can't do any further system testing. 
I have run the program under the control of animator and the record length it shows is 129.
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressYou stated previously that rebuild reported that the file had a variable recording mode even though all records are 129 bytes.
You might try adding the "recording mode is variable" clause to the FD to see if that makes a difference.
If it does not then I would suggest that you open up a support incident with customer care so that we can perhaps get one of your data files to work with and hopefully resolve the issue without the need for you to rebuild all of your files.
Thanks.
                
     
                                    
            I am trying to migrate some indexed files from Object Cobol 4.1. Some of these files have records which are not aligned on a 4 byte boundary. Object Cobol 4.1 must have allowed these, but Server Express 5.1 is detecting them and preventing them from being opened, returning a file status of "39". While I can recreate these files so that they will open OK, there are hundreds of archives all of which will need to be recreated. This will also involve an outage to system users, as we would wish to correct on our present system rather than the one we will migrate to - so that the data and code will be portable. Is there any setting in Server Express 5.1 which would allow the files to be opened without having to recreate them?
#ServerExpressYes, specifying "recording mode is variable" has allowed the files to open. 
Thanks very much. It has saved a lot of work!