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



At 16:08 08/04/98 -0400, Venu Yamajala wrote:
>SBMJOB    CMD(Call CL2  Parm(&App  &Day   &Log))
>
>&App is a character 5 field
>&Day is 5, 0 packed whose value is 0
>&Log is 9,0 packed whose value should be 1.
>

Venu,

This is normal behavior when you use SBMJOB CMD(CALL ...). The CALL command 
behaves exactly as it does from a command line. Since there is no pointer 
available, it stores packed values in 15.5 variables and passes pointers to 
those values. In reality, what you are receiving in your called program is a 
pointer to X'00000000000001F for &LOG, but your program is only processing the 
first 5 bytes, so it is receiving X'0000000000', which is being interpreted as 
decimal 0 with an invalid sign.

You can get around this several ways. 

1. Create your own command to pass the values exactly as you want them. If you 
define the command parameters as 5,0 and 9,0, that's what your program will 
receive.

2. Change the &DAY and &LOG parameter declarations in the called program to 
15.5.

3. Using CHGVAR, move the numeric values to character variables and pass the 
data that way. The called program will need to reverse the process (receive 
character values and move them to numeric variables with CHGVAR.

4. Put them in the LDA or other data area or data space. Depending on exactly 
how you do this, you may need to convert to/from character here also.

There's probably more that I forgot about, but you get the idea. I almost 
always use method 1, and have had no problems of this type, but I used to work 
with a lot of new AS/400 programmers, so I can tell you with certainty that you 
are not the first to be a little confused by this.

hth
Pete


Pete Hall
peteh@inwave.com 
http://www.inwave.com/~peteh/

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