× 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.



Y'all

This has been the way things work for over 20 years, I don't see it changing soon. One major issue, as I understand it, is that parameters are passed to programs by reference. (Procedures can be a different story, I believe.) That being the case, how do you know how much memory is to be used at each pointer that is passed? Certain assumptions have been established - 32 characters for strings, 15,5 packed for numbers.

Now Elvis has shown how numbers might be passed by putting in all leading and trailing zeroes to fill out whatever definition you are using. And you can send the entire character string, padded, IIRC. Although this thread puts some doubt into that statement.

Now the question is, where is this done? Essentially in things that are equivalent to using a CALL on a command line. Or, as stated here, where things go through the command parser. I think QCMDEXC could give you the same behavior.

This is probably documented somewhere. Ah! Found it!

Problem Summary:
When passing a Character Parameter that is defined longer than 32. Garbage is sometimes found in the PARM.

Resolution:
Character string contents that are greater than 32 in length are not padded to the full length of the PARM. The system will only pad up to 32. Beyond that is for the user to control. There are samples on how to correct this in the CL Programming manual, Chapter 3.

References:
CL Programming, SC41-5721-03, Chapter 3, Using the CALL COMMAND

This is from the registered software knowledge base - why is this kind of thing located where you have to register to get it? Oh, well, the real info is in the manual.

HTH
Vern

At 10:35 PM 11/14/2005, you wrote:

Lim:

I know you got answers and chose a direction. But this comes up so often that it deserves thorough discussion. Few seem to catch the relationship between CMD() and RQSDTA(). Rob has it fairly well worked out.

As I understand it, the rules apply when creating a 'request message' and it doesn't matter so much _how_ that's done, whether by some kind of interactive command line or SBMJOB or SBMRMTCMD or RUNRMTCMD or... whatever.

That's why the relevant parm on the SBMJOB is named RQSDTA() and its default is "*CMD" which means it will get its value from CMD() and why the <help> for the CMD() parm says that the value is used for the 'request data'. The 'request data' is what makes up the text of the 'request message' that is what actually gets submitted. Display your interactive joblog and use <F1> to look at any interactive command in your joblog to see that each one is message type 'Request'.

What you type into the CMD() parm is _not_ what gets submitted.

The value that you type gets passed through a command analyzer/parser/whatever and is reformatted as necessary to generate the value that becomes the RQSDTA(). Reformatting might truncate trailing spaces among other possibilities.

If you don't want that to happen, then you need to format RQSDTA() yourself or create a *CMD that can act as a kind of prototype that specifies the formatting or force it to retain trailing spaces by adding a non-blank out past the end (I'm not sure what the limit is). And that is regardless of whether it's interactive or batch or compiled.

Tom Liotta

midrange-l-request@xxxxxxxxxxxx wrote:

>   7. RE: SBMJOB is trimming the tailing blanks (Lim Hock-Chai)
>
>I always though that those rules only apply when submitting job from
>command line.
>
>Why would a CL program trims the tailing blank on the parm value when
>submitting job?
>
>-----Original Message-----
>From: midrange-l-bounces@xxxxxxxxxxxx
>[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob
>Sent: Friday, November 11, 2005 1:43 PM
>To: Midrange Systems Technical Discussion
>Subject: Re: SBMJOB is trimming the tailing blanks
>
>Do not use CALL on SBMJOB, especially with parameters!  Use either
>RQSDTA, or better yet, create a command (*CMD) that executes the program
>PGMB.
>There are too many rules with parameters and CL to have to remember,
>like it prefers 256A and 15.5packed.  @#$% like that.

--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertech.com


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


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.