The textfile is readable in COBOL. COBOL can have it's own indexed files.
It is possible that for some COBOL compiler there is a SQL precompiler which makes it possible to access the database. I don't have one for MS-Access.
Excel has a full functional output to exchange with other systems in ASCII format: the SYLK format with extension SLK.
There are good descriptions of that format available for example on the file formats CD-ROM of Dr. Dobbs.
you can populate fields in a File with Attributes from a SQL statement.
EXEC SQL
SELECT SSN, NAME
INTO :O-SSN, :O-NAME
FROM MYTABLE
END-EXEC
This is a generic example from A Guide to SQL, by Philip J Pratt, Third Edition. The exact from of the SQL may differ. The fields in the file are in the into section. I am sure someone has a real example in a given SQL server language if you want something specific. My example doesnt show how each record is written. There are products that can make files also like EZTRIEVE and Decision Analyzer. If you do not like my post feel free to point out your opinion or my errors.
you may get a bit of difficulty with differing field lengths. I would create a CSV (comma separated variable file) as this is much easier for parsing from a flat file into a cobol program.
Access and Excel probably can export files with a built-in utility. As a programmer I personally don't use comma seperated variable length files on the mainframe. We used fixed length files.
Usually I am trying to do the reverse; go from fixed length to comma separated. Fortunately we have an application designed to do just that. Usually in VB files are made as comma, separated. I dont know what kind of utilities are available on the VB side. In a VB forum you could ask how to make a fixed length file maybe. A PC COBOL Compiler can probably be able to make a COBOL program that you can run on your PC. A Compiler from Micro Focus may have a utility to do that. If you do not like my post feel free to point out your opinion or my errors.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.