Correct, eval is only to be found in RPG/ILE. I would not recommend
that you try this in RPG/400 (aka. RPGIII), since string handling in the
old compiler sucks.
Is this comma-delimited output intended to be FTP'd or emailed? If so,
you should consider writing your output directly to an IFS streamfile.
This is quite easily done, and there are some wonderful resources
available to show you the way... (See
http://www.scottklement.com/rpg/ifs.html ) Note: if you roll your own,
please be careful when converting numeric values to character strings.
Negative values often foul things up...
Martin offered you his version of a database-to-CSV utility, but there
are dozens of similar tools available as freeware.
Hth,
Eric DeLong
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Al
Sent: Thursday, March 26, 2009 1:01 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Variable tips
Thanks
I don't see EVAL in RPG/400 manual ... is that in RPG/ILE or SQL/400
embedded in RPG? I saw in that manual that if there are variable length
fields, RPG treats them as fixed ... I continue the struggle.
The necessary fields & constants input from our data base are fixed
lengths:
5 8 8 15 15 5 3 15 15 11 11 13 11 6 15
Some alpha some numeric, most after "translation" (eliminate leading
zeros,
trailing blanks, insert decimal point, minus sign, append comma) will be
shorter, with different transactions getting different resulting widths
for
same files (quantity, price, etc.) that need to be appended to the end
of
previously translated collection whose aggregate length will only be
known
as we go along at execution time. So to keep track of that is aggregate
lengths of so far & I am unsure yet how to do the appending.
Perhaps I shall put the whole thing in an array of 170 elements of one
byte
each, where each result is appended one byte at a time, by overlaying
what I
get in translation overlaying data structure of a 17 byte array of the
latest translated field.
-
Al Mac
As an Amazon Associate we earn from qualifying purchases.