Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7879851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:59:51+00:00 2026-06-03T03:59:51+00:00

We have an AS400 RPGLE program created within the library LMTLIB, which is called

  • 0

We have an AS400 RPGLE program created within the library LMTLIB, which is called ARTEST.

It has a single numeric inout parameter, which just returns 2

$myVar = "1";

$db = Zend_Registry::get('config')->resources->multidb->as400;

$abstractAdapter = new Zend_Db_Adapter_Db2($db);

//Gives the message "Invalid bind-variable position 'myVar'"
$sql = 'CALL QSYS.QCMDEXC(\'CALL LMTLIB.ARTEST PARM(?)\', 0000000026.00000)';

//Gives the message "Token PARM was not valid. Valid tokens: ( INTO USING. SQLCODE=-104"    
$sql = 'CALL LMTLIB.ARTEST PARM(?)';

//Gives the message "ARTEST in LMTLIB type *N not found. SQLCODE=-204"
$sql = 'CALL LMTLIB.ARTEST (?)';

$stmt = new Zend_Db_Statement_Db2($abstractAdapter, $sql);

$stmt->bindParam('myVar', $myVar, 4, 1);

$stmt->execute();

Now, i can kind-of understand why the third SQL statement would fail with the “not found” message… because it is not a table / file, but rather an RPGLE program.

The thing thats irritating, is that if i remove the (?), and simply put in (1)… the SQL call appears to be successful, and the RPGLE program shows it had been called. However, I’m then not able to see what the response from the program was.

Thanks in advance for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:59:52+00:00Added an answer on June 3, 2026 at 3:59 am

    Generally, the database manager uses the CALL statement to invoke a stored procedure. When it does that, it looks for a stored proc whose parameter signature matches the signature of the CALL.

    If there’s no stored proc with that name and signature, the database manager tries to call a program. Again, there’s a parameter matching process that happens.

    http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/db2/rbafzmstcallsta.htm

    I suggest creating a stored procedure so you can get the parameters matched properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a PL/SQL program which do a query to an AS400 database through
I have a table on a iSeries(IBM-i/AS400) which has some constraints. The table is
We have a winforms appliction that has to talk to an AS400. To do
I have a script which moves and renames files from an AS400 directory to
I have a set of files in a library on an AS/400/iSeries/System-I/whatever-IBM-wants-me-to-call-it-these-days which I
We have a program on our AS400 that takes in a number, encrypts it
Have started playing with Xcode 4.2, and created a single page application using storyboard
I'm trying to connect to a AS400 server using the .net classes. I have
Have a matrix report now that has Position, Hours and Wages for a location
Have you ever created or encountered a self modifying code in Java? If yes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.