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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export db to CSV file

Status
Not open for further replies.

EMax1

MIS
Apr 8, 2004
95
0
0
US
Following my previous message.
Is there a command that will export a data file to a *.csv formated file, or other ascii file?
 
If it is RMS index sequential Files have you looked into CONVERT?

(HELP CONVERT),

To make a clean FDL just do an ANALYZE/FDL from f.e. your LOGIN.COM file. And try to convert the "database" to
ascii.

There might be a problem if the file contains binary data (numbers, dates etc.not converted to ascii strings.)

In that case make a simple program (Fortran, C, Cobol) or even DCL within some limits and convert the record you read to any format you want f.e. CSV file.



kind regards,

Nico Baggus
 
Well,
The best I got was:
I entered the command:
convert/document zza.dat-zza1.txt/format=text
and it asked me for the output, to which I answered again zza1.txt

After this I got the following message:
%DCL-W-ACTIMAGE, error activating image CDA$CONVERT
-CLI-E-IMAGEFNF, image file not foundNODE1$DKBo:[SYS0.SYSCOMMON.][SYSEXE]CDA$C;

I guess something is not set right to convert on this machine.

Whwn you say, a small; progarm, is there a structure to the data file? Structure that is fixed(I doubt) or structure I could find somewhere.

As you see I am not a big VMS specialist, I just try to convert the data to a database that is more familiar to me.
Thanks for any help.
Louis
 
Convert/DOCUMENT is not what you are looking for (Wordperfect -> WPS+ and back, after buying the conversion tools).

You want to look in to convert/FDL.

To be able to use that you should be able to just type the file to your screen and it should still be readbale.
(If it contain binary stuff, disconnect your session and start a new one. You will then also know that the file contains binary data.

Regarding the data file: You just say file/database
Almost any file can contain whatever data, you information is not sufficient.

I have no idea what is in it whatsoever.
.DAT is generic for just data. And all datafiles have some kind of structure, the only thing you need to know is what that structure is... Is the software that manages it still available? Is there documentation?



kind regards,

Nico Baggus
 
Louis,

specify your converted dat file to be a name other than the original.

$ help analyze
$ help convert

HTH
--Paul

Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
The files I try to convert are all data file that have information for Customers (Name addresses, etc) or item descrioptions. There is no pictures or other.
I did what you said and type 'type....' to view the file. It shows ASCII characteres and text I can read, but get lost if any non ascii character shows.

Otherwiase, I have full access to the software and data, since this system is currently in use. I am just preparing an other database to populate with the current data.

I need to read a lot more, but fort example i need to convert the file CUST.DAT (taht include some non ascii fields) to CUST.TXT (where I would like to have all in ASCII) Since I know the data entered, I do not see why these files should have any non ASCII characters in it. I meen images or such.
 
Well,

Numbers f.e. might be stored as binary data,
a 1 would probably take 2 or 4 bytes and be stored as
a "01 00" or "01 00 00 00" sequence.

You also might do the following:

DUMP/RECORD=COUNT=1 CUST.DAT

And compare the data you see with the first record on your file.

If there are interger fields up to 4 bytes
and the records are no longer than about 950 bytes
and the dates are strings and not binary values
(microseconds since 17 Nov 1785, (VMS base time)
seconds since 1 jan 1970 (Unix/C runtime library base)
Days since 1900 + separate time field (many databases))
than a relatively simple DCL procedure can be used to export your data.

Otherwise you will need a more elaborate program to convert you binary values into ascii.


kind regards,

Nico Baggus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top