× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 in
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:
http://iprodeveloper.com/rpg-programming/apis-example-list-fields-quslfld
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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.