Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CONVERT access or excel file.

Status
Not open for further replies.

lode

Programmer
Nov 8, 2001
208
BE
Hi,

I'm a programmer in VB.
Is it possible to convert an MS Access table into a COBOL-file.
I have to admit that i don't know anything about COBOL !!

Thanks.
 
Hi,

it is always possible to create a text file.

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.

I hope this is helpful.

Regards,

Crox


 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top