Solved

Parameters passed on CALL do not match those required.

Posted on 2006-11-19
10
1,975 Views
Last Modified: 2012-06-22
Hi,

I have an adapter that is running on AS400 Machine. The functionality of this adapter is to get the message from one queue, checks the messageID of the message present in the message header.

There is a configuration(ini) file that helps out to match this MessageID. If the MessageID is "AB" the it puts to queue "AB1" else if MessageID is "CD" the it puts to queue "CD1".

When I run this adapter manually using the call program the adapter executes well picks the message correctly and put to correct queue. Below is how I call the adapter manually
call PGM(ABCD/ADAPTERSUB) PARM(('-c') ('/ABC/adapters/AdapterSubscribe/AdapterSub.ini'))

ADAPTERSUB is the executable of the adapter present in the ABCD library and "-C" is the parameter and then followed by the path where the adapter configuration file resides. This is working fine.

I have created a script file called "ADSUB.PGM" and compiled to ABCD library. In the script I have specified the above path, I have created this script so that I need not call the above big statement many times. When ever I need this adapter to run I can call the script file "ADSUB".

I have executed this adapter against the queue and it well executed the adapter picked the message and put to queue.

Since the adapter is working perfectly I created a Trigger to the queue. I created the process defination and in the ApplicationID I have given the Script name "ABCD/ADSUB". I have assigned the Initiation queue and processDefination to the queue where the message will be picked call the queue as "INPUT.Q". I have switched on the trigger for this queue. The process name is "ADSUBENT"

When I put the message to this queue, the trigger goes off and the message remains in the queue and not picked by the adapter.

I saw the Joblog for and found out the the below error :

CPI1125    Information             00    11/17/06   00:27:39   QWTPIIPP       QSYS        02DC     *EXT                      *N
                                     Message . . . . :   Job 100637/QMQM/QDFTJOBD submitted.
                                     Cause . . . . . :   Job 100637/QMQM/QDFTJOBD submitted to job queue QBATCH in
                                       QGPL from job 099541/QMQM/RUNMQTRM. Job 100637/QMQM/QDFTJOBD was started
                                       using the Submit Job (SBMJOB) command with the following job attributes:
                                       JOBPTY(5) OUTPTY(5) PRTTXT() RTGDTA(QCMDB) SYSLIBL(RBTSYSLIB  QSYS
                                       QSYS2      QHLPSYS    QUSRSYS    QMQMJAVA) CURLIB(*CRTDFT) INLLIBL(QTEMP
                                        QMQM       QGPL) LOG(4 00 *NOLIST) LOGCLPGM(*NO) INQMSGRPY(*RQD)
                                       OUTQ(/*DEV) PRTDEV(PRT01) HOLD(*NO) DATE(*SYSVAL) SWS(00000000)
                                       MSGQ(QUSRSYS/QMQM) CCSID(65535) SRTSEQ(*N/*HEX) LANGID(ENU) CNTRYID(US)
                                       ALWMLTTHD(*NO).
*NONE      Request                       11/17/06   00:27:39   QWTSCSBJ                   *N       QCMD         QSYS         0173
                                     Message . . . . :  -QSYS/CALL PGM(ABCD/ADSUB) PARM('TMC    2INPUT.Q
                                                                     ADSUBENT

                                       ABCD/ADSUB





                                                                                        AB400
                                                            ')
CPD0172    Diagnostic              30    11/17/06   00:27:39   QCACALL        QSYS        02A3     QCMD         QSYS         01A1
                                     Message . . . . :   Parameters passed on CALL do not match those required.
                                     Cause . . . . . :   The parameters passed on the CALL command do not match the
                                       parameters required by program ADSUB in library ABCD. Correct program not
                                       found or correct parameters not passed. The number of parameters or the type
                                       of parameters passed on the CALL command must match those expected by the
                                       program called. Recovery  . . . :   If correct program not found, change or
                                       specify the library name on the command or in a library list. Change the
                                       CALL command and then try the command again.
CPF0001    Escape                  30    11/17/06   00:27:39   QCACALL        QSYS        02B5     QCMD         QSYS         01A1
                                     Message . . . . :   Error found on CALL command.
                                     Cause . . . . . :   The system detected errors in the command. Recovery  . . .
                                       :   See the previously listed messages in the job log. Correct the errors
                                       and then try the command again.  *N instead of a command name means that the
                                       name had not been determined before the error was found.
CPC2402    Completion              50    11/17/06   00:27:39   QCMD           QSYS        05D4     *EXT                      *N
                                     Message . . . . :   Job ended. Cancel message received at command processor.
                                     Cause . . . . . :   A message with a severity equal to or exceeding the end
                                       severity was received at the command processor. Recovery  . . . :   See the
                                       messages previously listed to determine the message that caused the job to
                                       be ended. Correct the errors, and then try the request again.
CPF1164    Completion              00    11/17/06   00:27:39   QWTMCEOJ       QSYS        00BC     *EXT                      *N
                                     Message . . . . :   Job 100637/QMQM/QDFTJOBD ended on 11/17/06 at 00:27:39; 1
                                       seconds used; end code 20 .
                                     Cause . . . . . :   Job 100637/QMQM/QDFTJOBD completed on 11/17/06 at 00:27:39
                                       after it used 1 seconds processing unit time.  The job had ending code 20.

From the error log I find that the parameters passed are incorrect, but when I manually run the script using "Call (ABCD/ADSUB)" it worked fine pulled the message from source queue and put to the target queue with out any error.

But when I use the same in the trigger it give me an error.

Also, please let me know what is meant by "QCACALL"

Please provide me a solution.

Thanks,
Ross

0
Comment
Question by:vikashrk
  • 5
  • 3
  • 2
10 Comments
 
LVL 14

Expert Comment

by:daveslater
Comment Utility
Hi
looking at the job log the program is call with the following command

QSYS/CALL PGM(ABCD/ADSUB) PARM('TMC    2INPUT.Q
                                                                     ADSUBENT
                                       ABCD/ADSUB
                                                                                        AB400
                                                            ')



There is only one parm passed.                     <>  
QSYS/CALL PGM(ABCD/ADSUB) PARM('TMC    ' 'INPUT.Q
                                                                     ADSUBENT
                                       ABCD/ADSUB
                                                                                        AB400
                                                            ')



I would expect it to look like



What language have you written the  trigger in? and can you post the trigger code.

Dave
0
 
LVL 27

Expert Comment

by:tliotta
Comment Utility
Ross:

Your joblog shows this command:

---------- Begin
QSYS/CALL PGM(ABCD/ADSUB) PARM('TMC    2INPUT.Q
                                                                     ADSUBENT
                                       ABCD/ADSUB
                                                                                        AB400
                                                            ')
---------- End

However, you said you run this command:

> ...I manually run the script using "Call (ABCD/ADSUB)"

Those are two very different commands. The CALL command shown in the joblog has a long PARM() being passed. But you said you don't pass any parms.

The joblog shows that the command was submitted by a job named 099541/QMQM/RUNMQTRM which would seem to be a MQ job. Since you're reading queues that makes sense.

Dave may be familiar with MQ; his answer seems to indicate that he is.

However, if it works when you run [Call (ABCD/ADSUB)], he will probably need to see how your ADSUB program declares its parameters and how it handles parms that aren't passed.

Tom
.
0
 

Author Comment

by:vikashrk
Comment Utility
Dave,

Thanks for the reply.

I executed the below line from the command Entry
QSYS/CALL PGM(ABCD/ADSUB) PARM('TMC    ' 'INPUT.Q
                                                                     ADSUBENT
                                       ABCD/ADSUB
                                                                                        AB400
                                                            ')
But it still gives me the same error "Parameters passed on CALL do not match those required".  

below is the trigger code. i.e. script that I wrote ADSUB.PGM
***************************************************************************************************
Pgm Parm()

DCL  VAR(&INIFILE) TYPE(*CHAR) LEN(128) +
        VALUE('/ABC/adapters/AdapterSubscribe/AdapterSub.ini')
DCL   &CMD     *Char 512 Value('CALL ABCD/ADAPTERSUB PARM(''-c''')
DCL   &CMDLEN  *DEC (15 5) VALUE(512)

/* Build the CMD string to execute --------------------- */
ChgVar &CMD Value(&CMD *TCat ' ' *Cat '''' *Cat &INIFILE *TCat '''')
ChgVar &CMD Value(&CMD *TCat ')')


/* Call the adapter ------------------------------------ */
call QCMDEXC (&CMD &CMDLEN)
MonMsg CPF0000 Exec(GoTo ERROR)

/* Check the log for errors ---------------------------- */
/* An exception is thrown when an error is found ------- */
WIATECH/CHKLOGFILE +
      PATH('/ABC/adapters/AdapterSubscribe/Log/AdapterSub.log') +
      SCAN('ITONOTIFY') MSGQ(WIA) SEV(3)
MonMsg CPF0000 Exec(GoTo ERROR)

GoTo EOJ

ERROR:

DmpCLPgm

/* Send a message to WIAINITIAT indicating an error has occured -- */
/* This call is used in place of return codes from the adapter. -- */
SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) +
            MsgDTA('ERROR in ADSUB') MsgType(*ESCAPE)
MonMsg CPF0000

EOJ:
EndPgm
****************** End of data ****************************************

when I execute the script manually, ie calling at the command entry as "CALL PGM(ABCD/ADSUB)" the script works fine without any errors. It also picks message from the queue and puts to target queue.

Please reply.

0
 

Author Comment

by:vikashrk
Comment Utility
The process name for the queue is "ADSUBENT". In the applicationID i gave the value as ABCD/ADSUB. I didnt give any values to the EnvID and Userdata but specified applcationType as OS/400.
0
 
LVL 14

Expert Comment

by:daveslater
Comment Utility
Hi
why are you building the command string to use qcmdexc.
you could simply use

dcl &p1 value('-c')
dcl &p2 value('/ABC/adapters/AdapterSubscribe/AdapterSub.ini')


call CALL ABCD/ADAPTERSUB (&p1 &p2)


dave

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:vikashrk
Comment Utility
That is the way all our scripts are build.

Do you think that this issue of triggering would be because of the Command Strings?

But the script executes fine withou triggering.

Ross.
0
 
LVL 14

Expert Comment

by:daveslater
Comment Utility
Hi
can you just try the above method and see if it works.
I will look at the CL later.

dave
0
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points
Comment Utility
Please note that a CLP will throw the mismatched parameters message if (1) you call it with a parm but (2) you don't declare a parm in the program.

You are calling ABCD/ADSUB with a parm specified. But you show the source as not declaring a parm by [Pgm Parm()].

Is this a CLP or is it ILE CL?

Tom
0
 

Author Comment

by:vikashrk
Comment Utility
Hey Tom,

Thanks a lot man. Your point gave me light.

I passed a parameter &TRIGSTRUCT in PGM PARM(&TRIGSTRUCT) and declared as DCL &TRIGSTRUCT *CHAR 715

I have defined the script in the appliationID.

It worked. Thanks for the help.

Ross.
0
 

Author Comment

by:vikashrk
Comment Utility
Dave,

Your script also worked for me, but we follow the script pattern that I have given you in the second thread. So, in my script i have given u i made a small change in

/*Pgm Parm()

DCL  VAR(&INIFILE) TYPE(*CHAR) LEN(128) +
        VALUE('/ABC/adapters/AdapterSubscribe/AdapterSub.ini')
DCL   &CMD     *Char 512 Value('CALL ABCD/ADAPTERSUB PARM(''-c''')
DCL   &CMDLEN  *DEC (15 5) VALUE(512)*/

to

Pgm Parm(&TRIGSTRUCT)

DCL &TRIGSTRUCT *CHAR 715
DCL  VAR(&INIFILE) TYPE(*CHAR) LEN(128) +
        VALUE('/ABC/adapters/AdapterSubscribe/AdapterSub.ini')
DCL   &CMD     *Char 512 Value('CALL ABCD/ADAPTERSUB PARM(''-c''')
DCL   &CMDLEN  *DEC (15 5) VALUE(512)

I have executed this script manually as well given the script name as the value for the applicationID of process defination. I switched on the trigger and put the message to the queue.

The message is pulled out from the queue and put to target queue.

Thanks a lot for all the help.

In think in future if any one posts this kind of query we can suggest him this solution.

Ross.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now