|
On Thu, Jul 17, 2014 at 4:47 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
If you wanted to, you could use the QUSLFLD API to list the fields inhttp://iprodeveloper.com/rpg-programming/apis-example-list-fields-quslfld
each file and set up automatic code to deal with each one, whether you
need to edit numeric fields, trim character fields, etc. Carsten wrote
an article on that:
This has a bit of a learning curve.
Yeah, probably too much for his deadline. If he were going to put in
that level of effort, he might as well just learn enough Python to do
his task (which isn't a lot).
Step 2 would be to write an RPG program that reads the work file by key
and writes only the text field out to the IFS. Scott's IFS APIs can
help, as might Jon's RPGOA article. Either one is easy to use and will
not impose a huge learning curve. Basically just READ the table and
write() the IFS file.
Um, I suspect it would actually be quicker and simpler, once he's set
up the work file with the keys, to use files and CL commands,
particularly if he isn't already versed in working with IFS stream
files. For example, RGZPFM the work file. Copy it to another
workfile, which doesn't have the keys, using FMTOPT(*MAP *DROP). Then
CPYTOSTMF.
I don't miss dealing with home grown EDI one bit.
I hear you, and I doubt it's many people's idea of a fun project. But
it is stunningly less painful if you use Python (or similar-level
language). All that delimiter stuff, heterogeneous data types (even
if not known until run time), and especially the quoting if that's
something you need to do, just goes away (because well-established
libraries to do all that are either already included or just a free
download away, and whatever logic is left that isn't in those
libraries tends to be easier to write in Python than in RPG).
John Y.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.