something strange passing parameters…

25 pts.
Tags:
AS/400
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

Answer Wiki

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

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

Discuss This Question:  

 
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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following