Main Menu

KB#00012-How to export your BBx data files to ASCII


How to export your BBx data files to ASCII


If you just want to throw the BBx-delimited fields into an ASCII-delimited file and figure out the data on the other side, you can do this. Something like the following logic should work: 

1) Open the file. 
2) Get the record length. 
3) Create an empty STRING file. 
4) start a loop that uses READ RECORD. 
A) Create an empty export string. 
B) Parse the record for the first $0A$ delimiter. Be sure to allow for trailing nulls (though I think that would indicate a corruption--all the fields should end with $0A$). 
C) Add each field to the empty string, encapsulating with something like $22$+field$+$22$+",". 
D) Strip the trailing comma from your export string. 
E) Write the export string to the STRING file. 

And there you have a generic ASCII export program, but remember that it will only export delimited fields, not fixed-length fields. You will have to parse the data somewhere, and that will require a knowledge of the file structures. 

It would help if you had a valid data dictionary for the file set you need to export. You could use the above logic to write a "custom" export program without too much effort, drawing information from the data dictionary as you go. 

Last Modified: 02/25/1998 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel