Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
CIAC Absent Member.
Absent Member.
1246 views

Chain of Records is Broken

Jump to solution

Hi.
I have a problem with a file with the index destroyed. I tried to recover it with the rebuild option but my message is "broken chain of records". If the file generated replacement lose a lot of records.
Is there another option that i can use to retrieve the index of this file?
Thank you.

0 Likes
1 Solution

Accepted Solutions
PHenskens Absent Member.
Absent Member.

RE: Chain of Records is Broken

Jump to solution

Hello CIAC,

First of all it would be helpfull if you could tell us the Vision version, are you still using the older Vision 3 format with index blocks stored in between the datablocks?  so just 1 file instead of the later Vision versions using a seperate data and index file?

Have you tried rebuilding using alternate keys?

If nothing works you could write a small program that reads through the Vision file and saves the records until it hits the "broken chain of records part,  then  start reading through the file from the end backward  saving the records to another file   until you hit the broken chain of records again,  than at least you hopefully have been able to save most of the records.

So:

1. create config file  with in it:

ERRORS_OK ON

2.  write small Cobol program that opens the problem file for input,  open a second file with same FD (just add other suffix)  for I-O.

The program should do something like:

move high-values to llbe2-pkey

           start llbe key not > llbe2-pkey

           perform Acu-llbe-Read-previous

           perform until llbe-status = "10"

               compute was-teller = ws-teller + 1

               move llbe2-rec to ph2-rec

               perform Acu-piet-Rec-Write

               perform Acu-llbe-Read-previous

           end-perform

Off course this needs to be adjusted to your data file!

This will read through the corrupted file backwards wrting the readable records into the second file.

When it hits the problem, you should close the problem file   open it again  then:

move low-values to llbe2-pkey

           start llbe key not < llbe2-pkey

           perform Acu-llbe-Read-next

           perform until llbe-status = "10"

               compute was-teller = ws-teller + 1

               move llbe2-rec to ph2-rec

               perform Acu-piet-Rec-Write

               perform Acu-llbe-Read-next

           end-perform

Until you hit the error and than close the files and program,  the new file should have a lot of the records saved,  compare the records saved to how many were in the corrupted file.

Anyhow, the above are cut and pastes out of a small program I wrote to save  a corrupted file from a customer, it was generated in Acubench  but you should see from it how to write your own "save-what-can-be-saved"  Cobol program  without using Acubench.

Best regards and good luck,

Piet

View solution in original post

0 Likes
1 Reply
PHenskens Absent Member.
Absent Member.

RE: Chain of Records is Broken

Jump to solution

Hello CIAC,

First of all it would be helpfull if you could tell us the Vision version, are you still using the older Vision 3 format with index blocks stored in between the datablocks?  so just 1 file instead of the later Vision versions using a seperate data and index file?

Have you tried rebuilding using alternate keys?

If nothing works you could write a small program that reads through the Vision file and saves the records until it hits the "broken chain of records part,  then  start reading through the file from the end backward  saving the records to another file   until you hit the broken chain of records again,  than at least you hopefully have been able to save most of the records.

So:

1. create config file  with in it:

ERRORS_OK ON

2.  write small Cobol program that opens the problem file for input,  open a second file with same FD (just add other suffix)  for I-O.

The program should do something like:

move high-values to llbe2-pkey

           start llbe key not > llbe2-pkey

           perform Acu-llbe-Read-previous

           perform until llbe-status = "10"

               compute was-teller = ws-teller + 1

               move llbe2-rec to ph2-rec

               perform Acu-piet-Rec-Write

               perform Acu-llbe-Read-previous

           end-perform

Off course this needs to be adjusted to your data file!

This will read through the corrupted file backwards wrting the readable records into the second file.

When it hits the problem, you should close the problem file   open it again  then:

move low-values to llbe2-pkey

           start llbe key not < llbe2-pkey

           perform Acu-llbe-Read-next

           perform until llbe-status = "10"

               compute was-teller = ws-teller + 1

               move llbe2-rec to ph2-rec

               perform Acu-piet-Rec-Write

               perform Acu-llbe-Read-next

           end-perform

Until you hit the error and than close the files and program,  the new file should have a lot of the records saved,  compare the records saved to how many were in the corrupted file.

Anyhow, the above are cut and pastes out of a small program I wrote to save  a corrupted file from a customer, it was generated in Acubench  but you should see from it how to write your own "save-what-can-be-saved"  Cobol program  without using Acubench.

Best regards and good luck,

Piet

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.