|
On Thursday, August 27, 1998 4:36 PM, Rob Berendt [SMTP:rob@dekko.com]
wrote:
> Buck,
>
> You're right. I included something in the sample I emailed that I did
> not have in the actual code. Try this instead.
> DRecipientDS DS
> D RecOffSet 1 4B 0
> D AddrLen 5 8B 0
> D Format 9 16 INZ('ADDR0100')
> D DistrType 17 20B 0 INZ(0)
> D Reserved 21 24B 0 INZ(0)
> D Recipient 25 99 INZ('rob@dekko.com')
> C Eval RecOffSet = %Len(%Trim(RecipientDS))
> * In the above RecOffSet will be equal to 29 because the first two
> * subfields will be dropped.
> * Now that RecOffSet has been intialized we will get 37.
> C Eval RecOffSet = %Len(%Trim(RecipientDS))
> * In the following RecOffSet will be equal to 37. And it would be
> * even if it was our first C spec line.
> C Eval RecOffSet = %Len(%TrimR(RecipientDS))
>
> The big difference is the dropping of the INZ keyword on the first two
> subfields. That seemed to do the trick. Without the INZ they get
> trimmed. Sorry. I shouldn't have prettied up the code prior to the
> first email without testing it.
Ah. The reason for the difference is that RPG inizialises all data
structures to *BLANKS (x'40') The way to override this behaviour is INZ.
This DS has the following values when the program starts
'bbbbbbbbADDR0100...' If you specify INZ(0), then the first 2 fields
become binary zero (x'00') instead of binary 40404040.
Hope that helps.
Buck Calabro
Commsoft, Albany, NY
mailto:mcalabro@commsoft.net
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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-2025 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.