Another way is to create a self-submitting CL. You use RTVJOBA to find
out whether it's running in batch already or if it's interactive. If
it's running interactively, the CL submits itself to batch. In this
example, you'd call this CL CL_PGM, and you just call it (via a
prototype), and it will submit the call to batch for you.
PGM PARM(&packparm)
DCL VAR(&TYPE) TYPE(*CHAR) LEN(1)
DCL VAR(&PACKPARM) TYPE(*DEC) LEN(9 2)
RTVJOBA TYPE(&TYPE)
IF COND(&TYPE = '1') THEN(DO)
SBMJOB CMD(CALL PGM(CL_PGM) PARM(&PACKPARM))
RETURN
ENDDO
CALL VENDOR_PGM PARM(&PACKPARM)
ENDPGM
In your RPG
D CallCLPGM PR Extpgm( 'CL_PGM' )
D Packed_ 9 2
D Packed S 7 0
/free
Packed = 1234567.89;
Callclpgm(Packed);
Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.
E-mail: flapeyre@xxxxxxxx
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, May 15, 2007 10:23 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Packed decimal parameters
Josh,
What ARE you trying to do? Submit a job or call a program or what? On
a
straight call, people use packed data as parameters all the time - no
problem. SBMJOB is where you run into problems. And someone already
posted the FAQ on that. Read that - it is golden. I STRONGLY suggest
the
command interface as a solution. At one time someone documented a
technique to take a CLP source member, and by some strategic copying and
pasting copy and convert it to a CMD member.
I forget who this genius was but here's the link:
http://faq.midrange.com/data/cache/576.html
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.