× 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 Poul,

As you have figured out, VARYING variables do currently store the length in the 1st two positions; I believe in V6R1 it may optionally go up to 4 positions. In either case, CL does not have a VARYING variable type.

You haven't showed us your CL, but I'm guessing the "> 254 zero" means the variable you defined in your CL program is larger than the 254a your RPG program is passing to it. When passing parameters, the corresponding variables should match in length and type.

If your CL program defines MEFILE as char(300), your RPG program will not be able to do anything about pos.255-300 in that CL variable. This is actually not a good situation, since there's no telling what that extra storage is actually used for. The CL program assumes it's defined by the RPG program; the RPG program may actually use it, but not as part of the MEFILE variable. If the CL program modifies it, it could affect some other variable in your RPG program.

Bottom line, make sure the parameter definitions match.

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /

Aschenbrenner, Poul wrote:
I have now managed to remove the 2 Hex byte in start. It seems that VARYING set lengt of the Variable in start of this.
But then I get NULL char at the end. Haw can this be removed.
X'61D5C5E3C4C1E3C161A683A76D86A3974B899589404040404040404040404040400000
000000000 > 254 zero.
The Code I have added is this ex.
D MeFile S 254a

MeFile = %subst(MyFile : 1 : ChkFileLen);
CALLP NETPPECL(SBMPGM : SBMLIB : JOBDFILE : JOBDLIB : JOBQ : JOBQLIB : SBMUSER : MeFile);
I cant see any way in CL to trim them ither in RPG ??


I have now get the string with file name created in IFS.
But the file name have some strangers hex char in the start of varible
MyFile. ??
Here is my sample exit program. What can I do to remove the starting
hex char. ex. x'0028' it look like it has some form >off lengt of the
variable.
Is this normal when setting variable VARYING. I can se this in the CL program that i Call.


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.