Chatmaker
695 pts. | Oct 15 2009 4:02PM GMT
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)
TomLiotta
7675 pts. | Oct 18 2009 3:36AM GMT
(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
Philpl1jb
24540 pts. | Oct 18 2009 12:28PM GMT
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
Yorkshireman
3200 pts. | Oct 20 2009 8:25AM GMT
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.






