I need to write a Progress 4GL '.p' script that exports Progress
table records to a CSV (comma-separated value) file, and I have
some questions which the Progress Language Reference Guide doesn't
seem to address.
To refer back to in the questions below, here is the code I will
be using (or something similar), for a table called say 'cust':
OUTPUT TO cust.d:
FOR EACH cust:
EXPORT DELIMITER ',' recid cust.
OUTPUT CLOSE.
The questions I have are:
1. Will this 'recid cust' syntax dump for each record its
'recid' value followed by those of the actual fields
defined in the schema (and in the same order)? That's
the intention.
(I know recids are obsolete; but some tables include fields
of type recid, which I presume reference records in other
tables. So the recid values must all be saved, in order
to maintain all these links. Horrible, but there you go!)
2. If the table contains array fields, are these written
as separate comma-separated fields? e.g. if field is
a 3*array, is it just dumped as if it had been defined
as three consecutive 'scalar' fields of the same type?
If not, what is the format? Presumably if not it must
be a delimited string, and in that case I just need to
know the delimiter character.
3. If the table contains date fields, what is the easiest
way to ensure their values are written in a specified
format such as dd/mm/yyyy or yyyy-mm-dd?
(The program must actually dump more than one table.
But as the same date format would be wanted for all
tables, a program-wide default would be acceptable.)
Same kind of thing applies to numeric fields - I don't
want it 'pretty formatting' them with comma-separated
thousands!
Many thanks in advance for any replies or pointers.
Cheers
---------------------------------------------------------------------------
---------------------------------------------------------------------------
"Eternity is a long time, especially towards the end."
Woody Allen
---------------------------------------------------------------------------