|
Hi,
Here's the solution to ur problem :
To pass a number as parameter to a SBMJOB program, define the
number as : TYPE(*DEC) LEN(15 5) or as TYPE(*CHAR).
Here's the reason :
When u pass parameters to a SBMJOB program, the parameters are
passed by value rather than by reference. The reason being obvious -
the calling program may cease after Submitting the called program and
the variable used for passing the parameter will not be available after
the calling program ceases. So the contents of the parameter variables
are first converted to constants and then passed as constants.
And here's the point...CL passes numeric constants as 15,5. Any
other definition will require that the value be passed as a HEX value.
And this requires the number to have even no of digits (including the
sign, if present). If the contents of the numeric parameter variable
does not contain an EVEN no. of digits while Submitting the called
program in batch, the result is an invalid HEX value and hence the error
'DECIMAL DATA ERROR'.
Hope I was able to quell ur doubt...
Bye,
Sirosh Sridharan.
----Original Message Follows----
From: Silvio Santos <Silvio.Santos@brainag.com>
Reply-To: RPG400-L@midrange.com
To: "'RPG400'" <RPG400-L@midrange.com>
Subject: Passing Numeric Parms in SBMJOB. How ?
Date: Thu, 18 Mar 1999 18:52:20 -0000
Hello!
I have a RPG program that has to call another program in BATCH. So I
have to execute the command SBMJOB in there. But one of the parameters
is a numeric variable of the program (with no decimals positions), and I
don't know how to put (and use) it in the command.
Code extract:
Records for build an array with the command to execute:
** $PM (CL Parm-String)
SBMJOB CMD(CALL PGM(BASPG12) PARM(' // Parms that I
need to build
' '
')) JOB(
) JOBQ(###JQCAL) LOG(0 0 *NOLIST) JOBMSGQFL(*WRAP)
Thanks
|
Get Your Private, Free Email at http://www.hotmail.com
|