Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active March 31, 2016 21:03
Show Gist options
  • Select an option

  • Save phpdave/8c11db6df2a8fc33b1ce10591ccbfdc4 to your computer and use it in GitHub Desktop.

Select an option

Save phpdave/8c11db6df2a8fc33b1ce10591ccbfdc4 to your computer and use it in GitHub Desktop.
Dcl-ds PARM1_Ds Extname('FILE') Qualified End-ds;
Incoming parameter definition
Dcl-pr Entry Extpgm('RPGNAME');
PARM1 Char(%Len(PARM1_Ds.FIELDOFPARM1));
End-pr;
* Incoming parameter definition
Dcl-pi Entry;
PARM1 Char(%Len(PARM1_Ds.PARM1));
End-pi;
<?php
$parm1 = " ";
$dbh = new PDO('odbc:MYIBMI', 'user', 'pass');
$sth = $dbh->prepare("CALL SPROCNAME1(:PARM1INOUT)");
//must be length 9 or you get a null '0000067�' instead of '10000067'
$sth->bindParam(":PARM1INOUT", $parm2inout, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 9);
$sth->execute();
CREATE OR REPLACE PROCEDURE LIB.SPROCNAME1 (
INOUT PARM1 CHAR(8) )
LANGUAGE RPGLE
SPECIFIC LIB.SPROCNAME1
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
EXTERNAL NAME 'LIB/RPGNAME'
PARAMETER STYLE GENERAL ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment