|
Sample data structures: ds3p2 DS f3p2 3P 2 ds4p2 DS f4p2 4P 2 ... hdr-1 goes to logfile-fld1 Chain out to QADBIFLD for size of logfile-fld1. Let's say it is 3P2. Map this knowledge into a field, let's call it MAP. Let's also say that QADBIFLD says that it starts in position 20, or X. select where map=3p2 eval f3p2=thevalue eval substr(string:x:2)=ds3p2 where ... ... Starting to click? Rob Berendt ================== Remember the Cole! Marcin Sagan <itbamsag@bh.com. To: RPG400-L@midrange.com pl> cc: Sent by: Subject: Re: Data mapping owner-rpg400-l@mi drange.com 03/21/01 02:59 AM Please respond to RPG400-L This is EDI reason. You mean put over my flat record on record from my destination file? Sounds good, and how to handle numeric values in my flat record? I could concatenate hex strings and next convert to character, would it be good solution? By the way, and sorry for my ignorance but I always want to know who (what) is the "Cole"? :-) Thank You Rob >>> <rob@dekko.com> 03/20 5:31 >>> SQL would be a nice tool. Must be some alternative. Since many code developers shy away from it for some reason or the other. That being said, they're are packages out there designed to do this kind of processing for EDI reasons. We use a package from Harbinger. No source code is included however so their technique remains hidden. And the AS/400 we use it on does not have a compiler so it's not like they generate code on the fly. Mapping the data into a record is no big deal. This can be done with some string manipulation and by reading the file QADBIFLD. You might have to set up some temporary variables to help with the numerics. Hmm, try this. Create a file with a huge record size as one field. Declare this file in your RPG as USROPN. Compile it with level check turned off. Use the system command to OVRDBF this file to the files declared in your format file. I see an OVRDBF, OPEN, WRITE, CLOSE, DLTOVR for each record in your message file. Well you might limit this by doing control break processing based on the message format. Then you would only have to do the OVRDBF, OPEN, CLOSE and DLTOVR on each control break. Rob Berendt ================== Remember the Cole! Marcin Sagan <itbamsag@bh.com. To: RPG400-L@midrange.com pl> cc: Sent by: Subject: Odp: Re: Data mapping owner-rpg400-l@mi drange.com 03/20/01 09:40 AM Please respond to RPG400-L message file - this is flat text file, plus sign is data separator HDR+SomeData1+SomeData2 SND+SenderInfo1+SenderInfo2+SenderInfo3+..+SenderInfoN ADD+AdditionalInfo1+AdditionalInfo2+..+AdditionalInfoN . . EOM+ControlNumber Format of message file Tag Element Type .. Destination File Destination Field HDR 1 Num .. LOGFILE FLD1 HDR 2 Char .. LOGFILE FLD2 SND 1 Num .. ORDERS FLD1 SND 2 Num .. ORDERS FLD2 . . SND N Date .. ORDERS FLDN ADD 1 Num .. DETAILS FLD1 . . ADD N Char .. DETAILS FLDN EOD 1 Num .. LOGFILE FLD3 I want to read the message file search for tag in format file and write data to apropiate fields in files LOGFILE, ORDES, DETAILS Regards Marcin >>> <rob@dekko.com> 03/20 2:51 >>> Could you paste some sample records? And a sample usage? Rob Berendt ================== Remember the Cole! Marcin Sagan <itbamsag@bh.com. To: RPG400-L@midrange.com pl> cc: Sent by: Subject: Data mapping owner-rpg400-l@mi drange.com 03/20/01 04:29 AM Please respond to RPG400-L Hi all I need to do some sort of data mapping i.e. in file 1 I have message from other system in file 2 I have format of this message and names of files and fields where this information should be stored in my shop (Because format of message can be changed I would like to separate code from this format) How to write data to files/fields given as a parameter? Is there any way except SQL? Any API? Any ideas? Thanks in advice Marcin ! ! +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- ! ! ! ! ! ! ! ! ! ! +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.