It appears that you would need to move the individual fields to a new data
structure w/o varying length fields, then move that data structure.
Paul Therrien
Andeco Software, LLC
225-229-2491
paultherrien@xxxxxxxxxxxxxxxxxx
www.andecosoftware.com
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Jack Tucky
Sent: Sunday, March 30, 2014 12:51 PM
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: Varying fields questions
I modified Scott K's CSV code to process a string passed in instead of
reading from an IFS file. I called the function EDI_GetFld. I also added
parameters for field delimiter and record delimiter so that I could process
an EDI segment like this:
ISA*00* *00* *ZZ*SENDER *ZZ*RECEIVER
*140102*1141*U*00400*000047073*0*P**~
I use 18 EDI_GetFld's to fill all of the ISA's 18 fields. Everything looks
good.
EDI_getfld(peFldData: isa00: %size(isa00):sep:term)
EDI_getfld(peFldData: isa01: %size(isa01):sep:term), etc.
Isa00-ISA018 are defined as varying fields. They are in a DS that
represents all of the fields in an ISA Segment, ISA00 -ISA18.
My goal is to replace some 3rd party code that is no longer working. To
accomplish this and not have to change a bunch of programs, I need to move
this data structure to a 512 character max string, like this:
OutDta = ISA;
My problem is that OutDta contains varying field length bytes?
If you look at the individual fields, they look good:
ISA00 OF ISA = 'ISA'
ISA01 OF ISA = '00'
ISA02 OF ISA = ' '
ISA03 OF ISA = '00'
ISA04 OF ISA = ' '
ISA05 OF ISA = 'ZZ'
ISA06 OF ISA = 'SENDER '
ISA07 OF ISA = 'ZZ'
ISA08 OF ISA = 'RECEIVER '
ISA09 OF ISA = '140102'
ISA10 OF ISA = '1141'
ISA11 OF ISA = 'U'
ISA12 OF ISA = '00400'
But OutDta in debug/hex shows this:
0003C9E2 C10002F0 F0000A40 40404040 - ..ISA..00..
40404040 400002F0 F0000A40 40404040 - ..00..
40404040 400002E9 E9000FC7 C9C9C940 - ..ZZ..SEND
40404040 40404040 40400002 E9E9000F - ..ZZ..
C4E8D5C1 D4C9C340 40404040 40404000 - XXXXXXX .
06F1F4F0 F1F0F200 04F1F1F4 F10001E4 - .140102..1141..U
0005F0F0 F4F0F000 09F0F0F0 F0F4F7F0 - ..00400..0000470
F7F30001 F00001D7 00004000 01A10000 - 73..0..P.. ..~..
Is there a way to move my data structure that contains all varying fields
into a 512 character string and strip the lengths out? I've tried changing
Scott's code to use 512 fixed length fields as input and output but I can't
get that to work if I don't pass in 512 characters.
Sorry for the long post and I hope this makes sense. Thanks
Jack
--
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.