× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Hans,

Thanks for looking at this.  Yes, I checked the values with the debugger,
that's how I noticed the junk starting at pos.1025.  The inefficient Data =
%trimr(Text) was an attempt to get rid of that junk.  I'll try CONST, but
I'm still curious as to why VALUE doesn't work as expected, i.e. where's the
bug?  Why does it pad up to 1024, then have non-blank stuff?  BTW, here's
the debug values:

This was CnvRec in the RPGLE program just before doing the CALLP:

EVAL cnvrec:x
   00000     C7D340C3 D6D5E5C5 D9E2C9D6 D540D3D7   - GL CONVERSION LP
   00010     C840C7D3 40839695 A58599A2 89969540   - H GL conversion
   00020     8481A381 40869699 40F1F061 F3F161F0   - data for 10/31/0
   00030     F14081A2 40968640 F1F261F1 F261F0F1   - 1 as of 12/12/01
   00040     25404040 40404040 40404040 40404040   - .
   00050     40404040 40404040 40404040 40404040   -
   00060     40404040 40404040 40404040 40404040   -
   00070     40404040 40404040 40404040 40404040   -

Upon entry to IFS_prt before anything was executed:
EVAL text:x
   00000     C7D340C3 D6D5E5C5 D9E2C9D6 D540D3D7   - GL CONVERSION LP
   00010     C840C7D3 40839695 A58599A2 89969540   - H GL conversion
   00020     8481A381 40869699 40F1F061 F3F161F0   - data for 10/31/0
   00030     F14081A2 40968640 F1F261F1 F261F0F1   - 1 as of 12/12/01
   00040     25404040 40404040 40404040 40404040   - .
   00050     40404040 40404040 40404040 40404040   -
...duplicate lines omitted
   003F0     40404040 40404040 40404040 40404040   -
   00400     00000000 00000490 00000000 00000000   - .......°........
   00410     00000000 00000490 40404040 40404040   - .......°
   00420     00000000 00000490 40404040 40404040   - .......°
   00430     80000000 00000000 E1E8817B BC002CB0   - Ø.......÷Ya#¯..^
   00440     80000000 00000000 E1E8817B BC002CAF   - Ø.......÷Ya#¯..®
   00450     00000000 00000000 FFFFFFFE 00000008   - ........Ú....
   00460     80000000 00000000 E17C68B0 9400C460   - Ø.......÷@Ç^m.D-
   00470     00000020 3A000460 00000001 00000000   - .......-........
   00480     00000000 00000000 00000000 00000000   - ................
   00490     C7D340C3 D6D5E5C5 D9E2C9D6 D540D3D7   - GL CONVERSION LP
   004A0     C840C7D3 40839695 A58599A2 89969540   - H GL conversion
   004B0     8481A381 40869699 40F1F061 F3F161F0   - data for 10/31/0
   004C0     F14081A2 40968640 F1F261F1 F261F0F1   - 1 as of 12/12/01
   004D0     25404040 40404040 40404040 40404040   - .
   004E0     40404040 40404040 40404040 40404040   -
...duplicate lines omitted
   00880     40404040 40404040 40404040 40404040   -
   00890     00000000 00000490 00000000 00000000   - .......°........
   008A0     00000000 00000490 40404040 40404040   - .......°
   008B0     00000000 00000490 40404040 40404040   - .......°
   008C0     80000000 00000000 E1E8817B BC002CB0   - Ø.......÷Ya#¯..^
   008D0     80000000 00000000 E1E8817B BC002CAF   - Ø.......÷Ya#¯..®
   008E0     00000000 00000000 FFFFFFFE 00000008   - ........Ú....
   008F0     80000000 00000000 E17C68B0 9400C460   - Ø.......÷@Ç^m.D-
   00900     00000020 3A000460 00000001 00000000   - .......-........
   00910     00000000 00000000 00000000 00000000   - ................
   00920     40404040 40404040 40404040 40404040   -
...duplicate lines omitted
   07FD0     40404040 40404040 40404040 40404040   -
   07FE0     40404040 40404040 40404040 40404040   -
   07FF0     40404040 40404040 40404040 4040....   -

After the eval data = %trimr(text)
EVAL data:x
   00000     C7D340C3 D6D5E5C5 D9E2C9D6 D540D3D7   - GL CONVERSION LP
   00010     C840C7D3 40839695 A58599A2 89969540   - H GL conversion
   00020     8481A381 40869699 40F1F061 F3F161F0   - data for 10/31/0
   00030     F14081A2 40968640 F1F261F1 F261F0F1   - 1 as of 12/12/01
   00040     25404040 40404040 40404040 40404040   - .
   00050     40404040 40404040 40404040 40404040   -
...duplicate lines omitted
   003F0     40404040 40404040 40404040 40404040   -
   00400     00000000 00000490 00000000 00000000   - .......°........
   00410     00000000 00000490 40404040 40404040   - .......°
   00420     00000000 00000490 40404040 40404040   - .......°
   00430     80000000 00000000 E1E8817B BC002CB0   - Ø.......÷Ya#¯..^
   00440     80000000 00000000 E1E8817B BC002CAF   - Ø.......÷Ya#¯..®
   00450     00000000 00000000 FFFFFFFE 00000008   - ........Ú....
   00460     80000000 00000000 E17C68B0 9400C460   - Ø.......÷@Ç^m.D-
   00470     00000020 3A000460 00000001 00000000   - .......-........
   00480     00000000 00000000 00000000 00000000   - ................
   00490     40404040 40404040 40404040 40404040   -
...duplicate lines omitted
   07FE0     40404040 40404040 40404040 40404040   -
   07FF0     40404040 40404040 40404040 4040....   -

 notice that the stuff in 890-910 is gone, and also the repeat of data at
490-4E0.

Before the api_write
   EVAL nbrwritten
   NBRWRITTEN = 0

After the api_write
   EVAL nbrwritten
   NBRWRITTEN = 1168

Hopefully the non-blank stuff will mean something to you; the x'000490' in
there is interesting, as it's the offset to the repeated data.  I'd really
like to know what's going on, and where it's appropriate to use VALUE
instead of CONST.

tia,
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax



> >To me that sounds like it's effectively doing an EVAL TEXT = CNVREC in
the
> >above example.  If that's true, then TEXT should be padded with blanks
> after
> >the x'25'. Instead, starting at pos.1025, it has some junk, then repeats
> the
> >value in CnvRec.
> >
> >So what's the real story with the VALUE option?
>
> Did you check the values using the debugger?  As coded, the
> VALUE parameter should work fine, albeit inefficiently.  The
> recommended way to pass string parameters is using CONST
> VARYING, not by fixed length value parameters.
>
> Furthermore, your statement "EVAL Data=%trimr(Text)" is
> essentially a (very slow) no-op:  You're trimming the
> trailing blanks off the string.  But when you assign the
> value to another fixed length string variable, the value is
> padded on the right with more blanks!
>
> Regarding your bug, I don't think it's due to the coding of
> the VALUE parameter.  It must be somewhere else.
>
> Cheers!  Hans
>
> Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.