Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i do this in rpg

Status
Not open for further replies.

suziedavidqc

Programmer
Mar 27, 2003
3
FR
Hi everyone
i have a file_a with 1024 char lengh
like this example:

UNB+UNOA:1+00987654:ZZZ+1234556:ZZZ+990831:1617+000244++INVOICE'UNH+063297+INVOIC:D:94B:UN'BGM+380:I2::F227221O+083838158'
DTM+9:19990831161743:203'DTM+3:19990831:102'DTM+4:19990825:102'FTX+IIN+4++NotInsured'FTX+CUR+4++PL 13 SAP'FTX+PMT+4++3Months'RFF+ACL:0740'RFF+AAJ:DL1235225'
RFF+AOB:234232747'RFF+SM:60'RFF+ON:223400162'NAD+IV+1221231:160:ZZZ+To:A Place:Somewhere::1123343++23AStreet+CityName++Z1212Z+GB'RFF+VA:GB123456789'NAD+UD+00012318:160:ZZZ+++++++GB
NAD+II+00123221:160:ZZZ+++++++GBCTA+IC+AS-12:Nicholson'COM+01752/313224:TE'COM+01752/313218:FX'PAT+22+SeeDate:134::5082'DTM+13:19991125:102'TDT+12+++++++3:146'TOD+++CFR:158'PAC+1.0+3+2:ZZZ'MEA+WT++KG:0.200:1.000'


i have to write into file_b : each record comes like this:
without quotes.

UNB+UNOA:1+00987654:ZZZ+1234556:ZZZ+990831:1617+000244++INVOICE
UNH+063297+INVOIC:D:94B:UN
BGM+380:I2::F227221O+083838158
DTM+9:19990831161743:203
DTM+3:19990831:102
DTM+4:19990825:102
FTX+IIN+4++Not Insured
FTX+CUR+4++PL 13 SAP
FTX+PMT+4++3 Months
RFF+ACL:0740
RFF+AAJ:DL1235225
RFF+AOB:234232747
RFF+SM:60
RFF+ON:223400162
NAD+IV+1221231:160:ZZZ+To:A Place:Somewhere::1123343++23 A Street+CityName++Z12 12Z+GB
RFF+VA:GB123456789
NAD+UD+00012318:160:ZZZ+++++++GB
NAD+II+00123221:160:ZZZ+++++++GB
CTA+IC+AS-12:Nicholson
COM+01752/313224:TE
COM+01752/313218:FX
PAT+22+See Date:134::5082
DTM+13:19991125:102
TDT+12+++++++3:146
TOD+++CFR:158
PAC+1.0+3+2:ZZZ
MEA+WT++KG:0.200:1.000

How can i do this in rpg as400
anyone have idea
Thanks in advance
Suzie
 
I'm not sure how you're doing it now but have you considered using an array of 1024 x 1 and manipulating the array. RPG does not have a problem with the single quote '
 
Sorry for the late reply

Move the input field into an array of 1024 one character element. Process the array one element at a time to a similarly defined output array. Stop everytime you run into the quote, move the output array to the output field, output the record and clear the array. Keep going until your done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top