|
as parameters are passed as pointers.... depending on the format
expected by the called program you could use the following example :
you need to pass packed decimal as X'0000000F' or to expand binary
data to hexadecimal characters (using for example the MI cvthc
instruction/procedure)
<code>
H DFTACTGRP(*NO)
D PgmName S 10
D Packed S 7P 0
D Bin S 10I 0
D Lbin S 10I 0
D Command S 1024
D CmdLen S 15P 5
D CBin S 16
D RunCmd PR extpgm('QCMDEXC')
D cm 3000 options(*VarSize)
D const
D ln 15P 5 const
D Char2Hex PR ExtProc( 'cvthc' )
D * value
D * value
D 10I 0 value
C/free
PgmName = 'PGM000';
Packed = 1234;
Bin = 1234;
Lbin= 8;
Char2Hex(%addr(CBin):%addr(Bin):Lbin) ;
Command = 'SBMJOB CMD(CALL PGM(' +
PgmName + ') PARM( X''' +
%EDITC(Packed:'X') + 'F'' X''' +
%trim(CBin ) + ''') )' ;
CmdLen = %Len(%Trim(Command));
RunCmd(Command : CmdLen);
*INLR = *ON;
Return;
/End-free
</code>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.