Callin CLP with parameter

CL Program
CL programming

I have a CL program which needs two Parametersa as a input, when i call a pgm with values, the value are not properly passed. It gives me decimal data error.

For instance i gave values as

Call pgm(clpgm) Parm('14' 'aaaaa')

But it takes value as F1F44040404040.

Hel me out soon.

Thanks in advance




Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you are receiving a data decimal error, then the expected parm is numeric. CLP passing parms should always be character (IMHO) whenever possible or set at 15.5 as a numeric, because a numeric parm is expected to be 15.5 in length and decimals.

Previous response::

How have you declared the parameters in the programs ?




This should give you an idea. Last weeks discussion on this general topic.

Why do I have such a problem with passing to a program a 8 byte field using a parm.


<i>But it takes value as F1F44040404040.</i>

Because that is the value that you supplied, it is the value that you should expect. Commands should not be entered when they are not understood. CALL is a command.

The [help] text associated with CALL explains in some detail what you are seeing. (If you don’t know how to use [help], then the CL Programming manual is also available. The full detail is in the manual as well as in the Info Center for your release.)



CL programs treat decimal variables as packed. I’m not sure what length your incoming numeric parameter is but, based on the value you posted, if you enter the parameter on the command line as <b>x’0000000000014F'</b> you should see the intended value pass into the program.


Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Craig Hatmaker
    Call pgm(clpgm) Parm('14' 'aaaaa') Remove quotes from 14 - evidently the program you're calling defines the first variable as numeric but you are passing it as character. The call should look like: Call pgm(clpgm) Parm(14 'aaaaa') Caveat: the first parameter in the program called must be defined as *DEC (15, 5)
    1,860 pointsBadges:
  • Craig Hatmaker
    (if called from the command line)
    1,860 pointsBadges:
  • TomLiotta
    (if called from the command line) To clarify, it should work the same if the same CALL command is compiled or submitted to batch. I don't think the command line is the important element -- the omission of declared variables should be the important element. Command-line execution is the most common way, though SBMJOB is probably close. Tom
    125,585 pointsBadges:
  • philpl1jb
    There needs to be agreement between the passed parameters and the receiving parameters. In numerc types the receiving program will place it's map over the memory location passed to it so the types, lengths, and decimals need to be consistant. Call pgm(clpgm) Parm(x'014F' 'aaaaa') would work if you declare fld1 as *DEC 2 0 or Call pgm(clpgm) Parm(14 'aaaaa') would work if you declare fld1 as 15 5 or Call pgm(clpgm) Parm('14' 'aaaaa') would work if you declare fld1 as *char 2 Phil
    54,090 pointsBadges:
  • Yorkshireman
    This is a basic, fundamental error. any issue about parameter passing starts with 1) are the sender and receiver defining the location identically ? 2) are you data typing the values correctly and 3) Do I understand what I'm seeing? 4) Do I understand what I'm writing? Numeric parms do NOT need to be 15,5 - neither do alpha parms need to be 32. Anyone who thinks so needs to go read the manuals so helpfully provided by IBM. the value you are sending in is alphameric, wheras the function is ecpecting a packed decimal. As you are using a command line, you need to key enetr the correct data type for the parm. -= others have helpfully provided 'how to's for you.
    6,085 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: