25 pts.
 something strange passing parameters…
hi all, i will explain my problem : i have 2 CLP/400 programs, the first CLP1 who calls the second CLP2 by submitting it, and passing to him 35 parameters, for a total size of 1830 bytes (the largest parm is 256 char long), all parms are char defined. CLP1: PGM CHGVAR &P1 'toto' CHGVAR &P2 'titi' ... CHGVAR &P35 'tata' SBMJOB CMD(CALL CLP2 PARM(&P1 &P2 &P3 ... &P35)) ENDPGM CLP2: PGM (all my 35 parms) ... ENDPGM parms are strictly the same, same number, same picture but when CLP2 received these 35 parms, the last 7 parms contains wrong data (it seems to be memory contain), in fact something different than value the CLP1 passed to him !!? the 29 first parms are well passed, but why the next one not ? i made the test by calling CLP2 directly, by not submitting it, and it worked fine, the problem seems to be with the SBMJOB cmd... if someone could help me ? thanx for advance

Software/Hardware used:
ASKED: October 26, 2005  6:23 AM
UPDATED: November 16, 2009  8:15 AM

Answer Wiki:
I suppose strongly a classic error when SBMJOBing a call. When command processor inspect the sbmjob command, it reformat each parameter in as many segments of 32 chars as necessary. If one parameter value length is too short, parameter is truncated abnormaly. detection : add a ending mark to your parameters (IE any not blank character at the end) correction :make your params one char long more than usage request, load each end char with a "*" for example, remove it in the called cl. ========================================================= There are two correct ways to handle this. First, the CMD() parameter is the wrong one to use if the command will be CALL. The parameters to CALL are not typed, so the command prompter/analyzer cannot handle their values as needed. Don't use CMD() -- the correct parameter to use is RQSDTA(). In fact, what the CMD() parameter actually does is to cause the command prompter/analyzer to process the CMD() value to generate a string that gets used as the RQSDTA(). You can see a small bit of evidence of that by looking at the RQSDTA() default value and reading the <help> for it. Second, if you really insist on using CMD(), then define a command to put into the parameter. A command definition will provide the parameter attributes that are missing when you choose to leave them out by using CALL. Tom
Last Wiki Answer Submitted:  November 16, 2009  8:15 am  by  JPLamontre   0 pts.
All Answer Wiki Contributors:  JPLamontre   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _