|
The null byte map is one byte per field in the triggered file. The general layout of the buffer is: 96 bytes of fixed info. + Record size + Field count + Record size + Field count -----Original Message----- From: Jim Langston <jlangston@conexfreight.com> To: RPG400-L@midrange.com <RPG400-L@midrange.com> Date: Friday, January 07, 2000 6:32 PM Subject: Re: Trigger program input buffer layout >I found out why I was getting a blank record, but the >question still stands, how do I use Parm1 without >knowing the sizes of the Null Byte Record Map before >hand? > >Regards, > >Jim Langston > >Jim Langston wrote: > >> I'm writing my first trigger program and am basing it on >> the sample from the Infoseeker Bookshelf for V3R7M0. >> >> When this program runs, I am expecting the file I am opening, >> APUNIONBNK, to contain a new record that is an exact >> copy of the record added to my file. But it is blank. Here is the >> code it it's entirety. >> >> Also, the example shows the data structure being set up with the >> OldRecordBuffer, OldRecordMap, NewRecordBuffer and >> NewRecordMaps laid out. This is somewhat difficult to do. >> Mostly, because I don't know the size of the Null Byte Map >> before hand. What I wound up doing in this case was setting >> their size to the same as in the example (something like 4 bytes) >> and running it, and getting an error on my SubSt because the >> pointer was running off into la-la land. So I ran it in Debug, >> and displayed the value of the Null Byte Map Size, then went >> into the program and changed the DDS to reflect this. >> >> This seems an awfully cumbersome way to do it though, is there >> a better way? >> >> FAPUNIONBNKUF A F 150 DISK >> >> D Parm1 DS >> D FileName 1 10 >> D LibName 11 20 >> D MemName 21 30 >> D TrigEvent 31 31 >> D TrigTime 32 32 >> D CommLockLvl 33 33 >> D Reserved01 34 36 >> D CCSID 37 40B 0 >> D Reserved02 41 48 >> D OldOffset 49 52B 0 >> D OldLength 53 56B 0 >> D OldByteMapOff 57 60B 0 >> D OldByteMapLen 61 64B 0 >> D NewOffset 65 68B 0 >> D NewLength 69 72B 0 >> D NewByteMapOff 73 76B 0 >> D NewByteMapLen 77 80B 0 >> D Reserved03 81 96 >> D********* >> D OldRecord 97 246 >> D OldByteMap 247 276 >> D NewRecord 277 426 >> D NewByteMap 427 556 >> D********* >> D >> D Parm2 DS >> D Length 1 4B 0 >> D >> D NewBuffer DS 150 >> D >> D Offset S 5 0 >> >> IAPUNIONBNKNS >> I 1 150 NewRecord >> >> C *Entry PList >> C Parm1 Parm Parm1 >> C Parm2 Parm Parm2 >> C >> C Eval Offset = NewOffset + 1 >> C >> C Eval NewRecord = >> %SubSt(Parm1:Offset:150) >> C Write APUnionBnk NewBuffer >> C Eval *INLR = *ON >> >> Thanks in advance, >> >> Regards, >> >> Jim Langston > >+--- >| 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.