Toolkit Failure

General discussion on PHP
Post Reply
jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Toolkit Failure

Post by jord1322 » Fri Apr 29, 2016 1:44 pm

I have two Program Calls that I'm doing with the Zend PHP Toolkit, both of which are very similar, yet one works and one that fails, but we've been unable to determine why. The parameter list seems to be right and the values sent in are the same designation as the program requires. If anyone can take a look through the RPG version of the program below compared to the PHP Toolkit version after it for each and let me know if you see any problems that would be great!

RPG Program 1 (This one works)

Code: Select all

     H copyright('(C) Shoe Show 1999') fixnbr(*inputpacked)                                                             
      ****************************************************************                                                  
      *  S H O E   S H O W ,   I N C .                               *                                                  
      *   COPYRIGHT 1999 - SHOE SHOW,INC.                            *                                                  
      * This software product is copyrighted and all rights are      *                                                  
      * reserved by the author.  Copying or duplicating this product *                                                  
      * is a violation of the law.  This software product may not, in*                                                  
      * whole or part, be copied, photocopied, reproduced, translated*                                                  
      * or reduced to any electronic medium or machine readable form *                                                  
      * without prior consent, in writing, from the author.          *                                                  
      ****************************************************************                                                  
      * FUNCTIONAL AREA   - Inventory Control                                                                           
      * PROGRAM NAME      - inu142                                                                                      
      * DESCRIPTION       - Store Updates (Bases)                                                                       
      * OBJECT TYPE       - Module                                                                                      
      * PROGRAMMER        - Randy Gish                                                                                  
      * INPUT PARAMETERS  - Store Number         5.0                                                                    
      *                     Stock Number         6.0                                                                    
      *                     Width                1.0                                                                    
      *                     A/P Quantity         5.0                                                                    
      *                     Size Run Array       3.0 (dim 27)                                                           
      *                     Case Code            1                                                                      
      * OUTPUT PARAMETERS - None                                                                                        
      * DATE WRITTEN      - 12/06/99                                                                                    
      * CALLED PGMS       - none                                                                                        
      * SERVICE PGMS      - sys990                                                                                      
      * NOTES             - The Size Run Array consists of the actual base quantities. The Qty paramater contains       
      *                     the base quantity for accessories/handbags.                                                 
      *--------------------------------------------------------------*                                                  
      * REV#  S.E.   DATE    ------- PURPOSE -------                 *                                                  
      * | 1 | PIT | 9/12/00| 3 DIGIT STORE # CONVERSION - UPDATE NEW *                                                  
      * |   |     |        |   KEY LOCATION IN STUNIT ON ADDS        *                                                  
      * | 2 | PIT |10/31/00| 3 DIGIT STORE # CONVERSION - USE NEW    *                                                  
      * |   |     |        |   KEY TO ACCESS STUNIT                  *                                                  
      * | 4 | PIT |02/08/01| 3 DIGIT STORE # CONVERSION - TAKE OUT OLD                                                  
      * |   |     |        |   KEYS IN STUNIT ON ADDS                *                                                  
      * | 5 | KL  | 2/22/01| 3 DIGIT STORE # CONVERSION - UPDATE NEW *                                                  
      * |   |     |        |   KEY LOCATION IN STORPOS ON ADDS       *                                                  
      * | 6 | GCC | 3/29/01| 3 DIGIT STORE # CONVERSION - STORPOS    *                                                  
      * | 7 | KL  | 5/01/01| 3 DIGIT STORE # CONVERSION - TAKE OUT OLD                                                  
      * |   |     |        |   KEYS IN STORMSTR ON ADDS              *                                                  
      * | 8 | dgs |08/23/02| 3 DIGIT STORE # CONVERSION - BUPDATES   *                                                  
      * | 9 | dgs |06/18/03| Changed the program to move 'SM' into   *                                                  
      * |   |     |        | the first 2 positions of the stormstr   *                                                  
      * |   |     |        | file when writing a record.  Move 'SU'  *                                                  
      * |   |     |        | into the first 2 positions of the stunit*                                                  
      * |   |     |        | file when writing a record.             *                                                  
      ****************************************************************                                                  
     Fstorm02   uf a e           k disk    usropn                                                                       
     F                                     rename(storm02:smrec)                                                        
     Fstunit02  uf a e           k disk    usropn                                                                       
     F                                     rename(stunit02:surec)                                                       
     Fbupdates  if a e             disk    usropn                                                                       
     F                                     rename(bupdates:burec)                                                       
                                                                                                                        
      ****************************************************************                                                  
      * Tables and Arrays                                                                                               
      ****************************************************************                                                  
                                                                                                                        
      ****************************************************************                                                  
      * Constants                                                                                                       
      ****************************************************************                                                  
      *                                                                                                                 
     D #const          c                   const('N')                                                                   
     D #sm             c                   const('SM')                                                                  
     D #su             c                   const('SU')                                                                  
                                                                                                                        
      ****************************************************************                                                  
      * Variable Definitions                                                                                            
      ****************************************************************                                                  
     D #p0store#       s                   like(store#)                                                                 
     D #p0stock#       s                   like(stock#)                                                                 
     D #p0width        s                   like(width)                                                                  
     D #p0qty          s              5s 0                                                                              
     D #p0srary        s              3s 0 dim(27)                                                                      
     D #p0cascod       s              1a                                                                                
                                                                                                                        
     D CurDate         S               D   Datfmt(*mdy) Inz(*Sys)                                                       
     D Odatemdy        S               D   Datfmt(*mdy)                                                                 
     D dateiso         S               D   Datfmt(*iso) inz(*sys)                                                       
     D #1              s              1a                                                                                
                                                                                                                        
      ****************************************************************                                                  
      * Global Data Structures                                                                                          
      ****************************************************************                                                  
      * STORMSTR - FIELD DEFINITIONS                                                                                    
     D                 DS                                                                                               
     D  SMK001                 1     10                                                                                 
     D  SMSTK#                 1      6  0                                                                              
     D  SMWDTH                 7      7                                                                                 
     D  SMSTR#                 8     10  0                                                                              
     D                 DS                                                                                               
     D  SMF002                 1    129                                                                                 
     D*   BASE STOCK ARRAY (27X2)                                                                                       
     D  SMBST                  1     54                                                                                 
     D  @SB                    1     54  0                                                                              
     D                                     DIM(27)                                                                      
     D*   INVENTORY ARRAY (27X2)                                                                                        
     D  SMINV                 55    108                                                                                 
     D  @SM                   55    108  0                                                                              
     D                                     DIM(27)                                                                      
     D*   STOCK#                                                                                                        
     D  SMSTK                109    114  0                                                                              
     D*   WIDTH                                                                                                         
     D  SMWIDT               115    115  0                                                                              
     D*   5 DIGIT STORE #                                                                                               
     D  SMSTR                116    120  0                                                                              
     D*   UNUSED FIELDS                                                                                                 
     D  SMFLD7               121    122P 0                                                                              
     D  SMFLD8               123    124P 0                                                                              
     D  @SMFLD               121    124P 0 dim(2)                                                                       
     D*   ISSUE DATE                                                                                                    
     D  SMISDT               125    127  0                                                                              
     D*   CASE COUNTER                                                                                                  
     D  SMCASC               128    128                                                                                 
     D*   CASE FLAG                                                                                                     
     D  SMCASF               129    129                                                                                 
                                                                                                                        
      * STUNIT - FIELD DEFINITIONS                                                                                      
     D                 DS                                                                                               
     D  SUK001                 1     10                                                                                 
     D  SUSTK#                 1      6  0                                                                              
     D  SUWDTH                 7      7                                                                                 
     D  SUSTR#                 8     10  0                                                                              
     D                 DS                                                                                               
     D  SUF002                 1     25                                                                                 
     D*   BASE STOCK                                                                                                    
     D  SUBST                  1      2  0                                                                              
     D*   INVENTORY                                                                                                     
     D  SUINV                  3      4  0                                                                              
     D*   NEW KEY - STOCK                                                                                               
     D  SUSTK#5                5     10  0                                                                              
     D*   NEW KEY - WIDTH                                                                                               
     D  SUWDTH5               11     11  0                                                                              
     D*   NEW KEY - STORE                                                                                               
     D  SUSTR#5               12     16  0                                                                              
     D*   SALES                                                                                                         
     D  SUSLS                 19     20P 0                                                                              
     D*   ADDITIONAL INVENTORY                                                                                          
     D  SUADIV                21     23P 0                                                                              
     D*   CASE COUNTER                                                                                                  
     D  SUCASC                24     24  0                                                                              
     D*   CASE FLAG                                                                                                     
     D  SUCASF                25     25                                                                                 
                                                                                                                        
      * BUPDATES - FIELD DEFINITIONS                                                                                    
     D                 DS                                                                                               
     D  BUF001                 1    100                                                                                 
     D  BUSTR#                 1      5  0                                                                              
     D  BUSTK#                 6     11  0                                                                              
     D  BUWDTH                12     12                                                                                 
     D*   BASE STOCK ARRAY (27X2)                                                                                       
     D  BUBST                 14     67                                                                                 
     D  @BU                   14     67  0 dim(27)                                                                      
     D  BUUSER                68     77                                                                                 
     D  BUDATE                78     83  0                                                                              
     D  BUTIME                84     89  0                                                                              
                                                                                                                        
      * Program Status DS                                                                                               
     D pgmsts         sds                                                                                               
     D  #lcpgm                 1     10                                                                                 
     D  #lcjob               244    253                                                                                 
     D  #lcusr               254    263                                                                                 
                                                                                                                        
      **************************************************************************                                        
      * Data Dictionary                                                                                                 
      **************************************************************************                                        
     D ddict         e ds                  extname(datadictls)                                                          
                                                                                                                        
     I*****************************************************************                                                 
     I* INPUT SPECIFICATIONS                                                                                            
     I*****************************************************************                                                 
      * Renamed input format fields - STORM02                                                                           
     ISMREC                                                                                                             
     I              K00001                      SMK001                                                                  
     I              F00001                      SMF001                                                                  
     I              F00002                      SMF002                                                                  
      * Renamed input format fields - STUNIT                                                                            
     ISUREC                                                                                                             
     I              K00001                      SUK001                                                                  
     I              F00001                      SUF001                                                                  
     I              F00002                      SUF002                                                                  
     I              K00002                      SUK002                                                                  
                                                                                                                        
      * Renamed input format fields - BUPDATES                                                                          
     IBUREC                                                                                                             
     I              F00001                      BUF001                                                                  
                                                                                                                        
     I*****************************************************************                                                 
     I* MAINLINE                                                                                                        
     I*****************************************************************                                                 
      *                                                                                                                 
     C     *entry        plist                                                                                          
     C                   parm                    #p0store#                                                              
     C                   parm                    #p0stock#                                                              
     C                   parm                    #p0width                                                               
     C                   parm                    #p0qty                                                                 
     C                   parm                    #p0srary                                                               
     C                   parm                    #p0cascod                                                              
      *                                                                                                                 
     C                   move      #p0stock#     astock#           6                                                    
     C                   eval      #1 = %subst(astock#:1:1)                                                             
     C     #1            ifeq      '6'                                                                                  
     C     #1            oreq      '8'                                                                                  
     C     #1            oreq      '9'                                                                                  
     C                   exsr      basupdacchb                                                                          
     C                   else                                                                                           
     C                   exsr      basupdshoes                                                                          
     C                   endif                                                                                          
      *                                                                                                                 
     C                   eval      *inlr = *on                                                                          
     C                   return                                                                                         
      *                                                                                                                 
      ********************************************************************                                              
      * Update bases for accessories/handbags                                                                           
      ********************************************************************                                              
     C     basupdacchb   begsr                                                                                          
      *                                                                                                                 
     C                   open      stunit02                             99                                              
      *                                                                                                                 
     C     stuky1        klist                                                                                          
     C                   kfld                    kystore5a         5                                                    
     C                   kfld                    kystwd            7                                                    
      *                                                                                                                 
     C                   move      #p0store#     kystore5a                                                              
     C                   movel(p)  #p0stock#     kystwd                                                                 
     C                   move      #p0width      kystwd                                                                 
     C     stuky1        chain     surec                                                                                
     C                   if        %found                                                                               
     C                   move      #p0cascod     sucasf                                                                 
     C                   z-add     #p0qty        subst                                                                  
     C                   update    surec                                                                                
     C                   z-add     *zero         @bu                                                                    
     C                   z-add     #p0qty        @bu(1)                                                                 
     C                   exsr      basaud                                                                               
     C                   else                                                                                           
     c                   movel     #su           suf001                                                                 
     C                   move      *blank        suk001                                                                 
     C                   z-add     #p0stock#     sustk#5                                                                
     C                   move      #p0width      suwdth5                                                                
     C                   z-add     #p0store#     sustr#5                                                                
     C                   z-add     #p0qty        subst                                                                  
     C                   z-add     *zero         suinv                                                                  
     C                   z-add     *zero         susls                                                                  
     C                   z-add     *zero         suadiv                                                                 
     C                   move      *blank        sucasc                                                                 
     C                   move      #p0cascod     sucasf                                                                 
     C                   write     surec                                                                                
     C                   z-add     *zero         @bu                                                                    
     C                   z-add     #p0qty        @bu(1)                                                                 
     C                   exsr      basaud                                                                               
     C                   endif                                                                                          
      *                                                                                                                 
     C                   close     stunit02                             99                                              
      *                                                                                                                 
     C                   endsr                                                                                          
      *                                                                                                                 
      ********************************************************************                                              
      * Update bases for shoes                                                                                          
      ********************************************************************                                              
     C     basupdshoes   BEGSR                                                                                          
      *                                                                                                                 
     C                   open      storm02                              99                                              
      *                                                                                                                 
     C     stmky1        klist                                                                                          
     C                   kfld                    kystore5a         5                                                    
     C                   kfld                    kystwd            7                                                    
      *                                                                                                                 
     C                   move      #p0store#     kystore5a                                                              
     C                   movel(p)  #p0stock#     kystwd                                                                 
     C                   move      #p0width      kystwd                                                                 
     C     stmky1        chain     smrec                                                                                
     C                   if        %found                                                                               
     C                   move      #p0cascod     smcasf                                                                 
     C                   z-add     #p0srary      @sb                                                                    
     C                   update    smrec                                                                                
     C                   z-add     #p0srary      @bu                                                                    
     C                   exsr      basaud                                                                               
     C                   else                                                                                           
     c                   movel     #sm           smf001                                                                 
     C                   move      *blanks       smk001                                                                 
     C                   z-add     #p0srary      @sb                                                                    
     C                   z-add     *zero         @sm                                                                    
     C                   z-add     *zero         @smfld                                                                 
     C                   z-add     *zero         smisdt                                                                 
     C                   move      *blank        smcasc                                                                 
     C                   move      #p0cascod     smcasf                                                                 
     C                   z-add     #p0stock#     smstk                                                                  
     C                   move      #p0width      smwidt                                                                 
     C                   z-add     #p0store#     smstr                                                                  
     C                   write     smrec                                                                                
     C                   z-add     #p0srary      @bu                                                                    
     C                   exsr      basaud                                                                               
     C                   endif                                                                                          
      *                                                                                                                 
     C                   close     storm02                              99                                              
      *                                                                                                                 
     C                   endsr                                                                                          
      *                                                                                                                 
      ********************************************************************                                              
      * Write base update audit record                                                                                  
      ********************************************************************                                              
     C     basaud        BEGSR                                                                                          
      *                                                                                                                 
     C                   open      bupdates                             99                                              
      *                                                                                                                 
     C                   z-add     #p0store#     bustr#                                                                 
     C                   z-add     #p0stock#     bustk#                                                                 
     C                   move      #p0width      buwdth                                                                 
     C                   movel     #lcusr        buuser                                                                 
     C                   movel     curdate       budate                                                                 
     C                   time                    butime                                                                 
     C                   write     burec                                                                                
      *                                                                                                                 
     C     1             chain     burec                                        Dummy chain                             
      *                                                                                                                 
     C                   close     bupdates                             99                                              
      *                                                                                                                 
     C                   endsr                                                                                          
      *                                                                                                                 

PHP Toolkit Calling RPG Program One (This one works)

Code: Select all

//Initialize Toolkit Variables
$param = '';

//Set Toolkit Parameter Array		
$param[] = $this->Toolkit->AddParameterZoned('both', 5, 0, 'Store #', 'STORE', str_pad($this->getStore(), 5, '0', STR_PAD_LEFT));
$param[] = $this->Toolkit->AddParameterZoned('both', 6, 0, 'Stock #', 'STOCK', str_pad($this->getStock(), 6, '0', STR_PAD_LEFT));
$param[] = $this->Toolkit->AddParameterZoned('both', 1, 0, 'Width', 'WIDTH', $this->getWidth());
$param[] = $this->Toolkit->AddParameterZoned('in', 5, 0, 'Total', 'TOTAL', $total);
for($i = 0; $i < count($updates); $i++) {
	$padded = str_pad($i + 1, 2, '0', STR_PAD_LEFT);
	$param[] = $this->Toolkit->AddParameterZoned('in', 3, 0, 'Size ' . $padded, 'SIZE' . $padded, $updates[$i]);
};	
$param[] = $this->Toolkit->AddParameterChar('in', 1, 'Case Code', 'CODE', $code);

//echo "<pre>";
//print_r($param);
//echo "<pre>";

//Calls Program
//FORMAT: ("Program Name", "Library", param array variable, return value
//(optional, null if none), options (optional, null if none)
$servPgmResult = $this->Toolkit->PgmCall('INU142', 'PHPTSTLIB', $param, null, null);

//Check Toolkit Results
if(!$servPgmResult) {
	
	//If $servPgmResult Falls Set Error Message
	$error = true;
	$errorMessage = "Program failed.";
	
};

I'll add Program 2 (the one with the problem) in a reply.
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: Toolkit Failure

Post by jord1322 » Fri Apr 29, 2016 1:48 pm

Here is Program 2

RPG Program Two (for PHP Toolkit Call 2 that does NOT work)

Code: Select all

     H copyright('(C) Shoe Show 1999') fixnbr(*inputpacked)                                                             
      ****************************************************************                                                  
      *  S H O E   S H O W ,   I N C .                               *                                                  
      *   COPYRIGHT 1999 - SHOE SHOW,INC.                            *                                                  
      * This software product is copyrighted and all rights are      *                                                  
      * reserved by the author.  Copying or duplicating this product *                                                  
      * is a violation of the law.  This software product may not, in*                                                  
      * whole or part, be copied, photocopied, reproduced, translated*                                                  
      * or reduced to any electronic medium or machine readable form *                                                  
      * without prior consent, in writing, from the author.          *                                                  
      ****************************************************************                                                  
      * FUNCTIONAL AREA   - Inventory Control                                                                           
      * PROGRAM NAME      - inu143                                                                                      
      * DESCRIPTION       - Store Updates (New Store Hold to A/P)                                                       
      * OBJECT TYPE       - Module                                                                                      
      * PROGRAMMER        - Randy Gish                                                                                  
      * INPUT PARAMETERS  - Store Number         5.0                                                                    
      *                     Stock Number         6.0                                                                    
      *                     Width                1.0                                                                    
      *                     Quantity             5.0                                                                    
      *                     Size Run Array       3.0 (dim 27)                                                           
      * OUTPUT PARAMETERS - None                                                                                        
      * DATE WRITTEN      - 12/08/99                                                                                    
      * CALLED PGMS       - inu141                                                                                      
      * SERVICE PGMS      - none                                                                                        
      * NOTES             -                                                                                             
      ****************************************************************                                                  
      * REV#  S.E.   DATE    ------- PURPOSE -------                 *                                                  
      *--------------------------------------------------------------*                                                  
      * | 1 | JRS |02/29/00| Always assume case code                 *                                                  
      * | 2 | KL  |06/11/01| 3 digit store # conversion - digrpstr   *                                                  
      * | 3 | jdf |10/11/12| Skip stores N0014, N0015.               *                                                  
      ****************************************************************                                                  
     Fdigrprun  uf   f 1600     9aidisk    keyloc(1)                                                                    
     Fdigrps01  uf   f   64    14aidisk    keyloc(19)                                                                   
     Fnsaudit   o  a e             disk    usropn                                                                       
                                                                                                                        
      ****************************************************************                                                  
      * Tables and Arrays                                                                                               
      ****************************************************************                                                  
     D dx              s             54a   dim(26)                                                                      
     D wd              s              1a   dim(26)                                                                      
     D srs             s              1a   dim(5)                                                                       
     D dac             s              5p 0 dim(26)                                                                      
                                                                                                                        
      ****************************************************************                                                  
      * Constants                                                                                                       
      ****************************************************************                                                  
      *                                                                                                                 
     D #const          c                   const('N')                                                                   
                                                                                                                        
      ****************************************************************                                                  
      * Variable Definitions                                                                                            
      ****************************************************************                                                  
     D #p0store#       s                   like(store#)                                                                 
     D #p0stock#       s                   like(stock#)                                                                 
     D #p0width        s                   like(width)                                                                  
     D #p0qty          s              5s 0                                                                              
     D #p0srary        s              3s 0 dim(27)                                                                      
     D #p0grp          s              3                                                                                 
     D #p0srl          s              1                                                                                 
                                                                                                                        
     D #pxstore#       s                   like(store#)                                                                 
     D #pxstock#       s                   like(stock#)                                                                 
     D #pxwidth        s                   like(width)                                                                  
     D #pxtype         s              1a                                                                                
     D #pxqty          s              5s 0                                                                              
     D*#pxsrary        s              3s 0 dim(27)                                                                      
     D #pxupdwhs       s              1a                                                                                
                                                                                                                        
     D CurDate         S               D   Datfmt(*mdy) Inz(*Sys)                                                       
     D Odatemdy        S               D   Datfmt(*mdy)                                                                 
     D dateiso         S               D   Datfmt(*iso) inz(*sys)                                                       
     D #1              s              1a                                                                                
     D #lcstock#       s                   like(stock#)                                                                 
     D #lcwidth        s              1s 0                                                                              
     D$found           s               n                                                                                
     D$done            s               n                                                                                
     D$acchb           s               n                                                                                
     Dgrprunkey        s              9a                                                                                
     Dgrpstrkey        s             12a                                                                                
     D#lcinx1          s              3s 0                                                                              
     D#lcinx2          s              3s 0                                                                              
     D#x               s              3s 0                                                                              
     D#y               s              3s 0                                                                              
     D #lcalpha        s              1a                                                                                
     D #lcfactor       s              3s 0                                                                              
                                                                                                                        
      ****************************************************************                                                  
      * Global Data Structures                                                                                          
      ****************************************************************                                                  
      * Program Status DS                                                                                               
     D pgmsts         sds                                                                                               
     D  #lcpgm                 1     10                                                                                 
     D  #lcjob               244    253                                                                                 
     D  #lcusr               254    263                                                                                 
                                                                                                                        
     D                 ds                                                                                               
     D #pxsrary                       3s 0 dim(27)                                                                      
     D nsszr                   1     81                                                                                 
                                                                                                                        
      **************************************************************************                                        
      * Data Dictionary                                                                                                 
      **************************************************************************                                        
     D ddict         e ds                  extname(datadictls)                                                          
                                                                                                                        
     I*****************************************************************                                                 
     I* INPUT SPECIFICATIONS                                                                                            
     I*****************************************************************                                                 
      * DIGRPRUN File                                                                                                   
     IDIGRPRUN  NS                                                                                                      
     I*** STOCK NUMBER                                                                                                  
     I                                  1    6 0DSTOCK                                                                  
     I*** GROUP NUMBER                                                                                                  
     I                                  7    9  DGROUP                                                                  
     I                                  1    9  DSTGRP                                                                  
     I*** ORDER NUMBER                                                                                                  
     I                                 10   14 0DORDER                                                                  
     I*** RUN CODE                                                                                                      
     I                                 15   15  DRUNCD                                                                  
     I*** WIDTH ARRAY                                                                                                   
     I                                 16   41  DWD                                                                     
     I                                 16   41  wd                                                                      
     I*** ARRAY OF SIZE RUN ARRAYS                                                                                      
     I                                 42 1445  DX                                                                      
     I*** SIZE RUN 1                                                                                                    
     I                                 42   95  D01                                                                     
     I*** SIZE RUN 2                                                                                                    
     I                                 96  149  D02                                                                     
     I*** SIZE RUN 3                                                                                                    
     I                                150  203  D03                                                                     
     I*** SIZE RUN 4                                                                                                    
     I                                204  257  D04                                                                     
     I*** SIZE RUN 5                                                                                                    
     I                                258  311  D05                                                                     
     I*** SIZE RUN 6                                                                                                    
     I                                312  365  D06                                                                     
     I*** SIZE RUN 7                                                                                                    
     I                                366  419  D07                                                                     
     I*** SIZE RUN 8                                                                                                    
     I                                420  473  D08                                                                     
     I*** SIZE RUN 9                                                                                                    
     I                                474  527  D09                                                                     
     I*** SIZE RUN 10                                                                                                   
     I                                528  581  D10                                                                     
     I*** SIZE RUN 11                                                                                                   
     I                                582  635  D11                                                                     
     I*** SIZE RUN 12                                                                                                   
     I                                636  689  D12                                                                     
     I*** SIZE RUN 13                                                                                                   
     I                                690  743  D13                                                                     
     I*** SIZE RUN 14                                                                                                   
     I                                744  797  D14                                                                     
     I*** SIZE RUN 15                                                                                                   
     I                                798  851  D15                                                                     
     I*** SIZE RUN 16                                                                                                   
     I                                852  905  D16                                                                     
     I*** SIZE RUN 17                                                                                                   
     I                                906  959  D17                                                                     
     I*** SIZE RUN 18                                                                                                   
     I                                960 1013  D18                                                                     
     I*** SIZE RUN 19                                                                                                   
     I                               1014 1067  D19                                                                     
     I*** SIZE RUN 20                                                                                                   
     I                               1068 1121  D20                                                                     
     I*** SIZE RUN 21                                                                                                   
     I                               1122 1175  D21                                                                     
     I*** SIZE RUN 22                                                                                                   
     I                               1176 1229  D22                                                                     
     I*** SIZE RUN 23                                                                                                   
     I                               1230 1283  D23                                                                     
     I*** SIZE RUN 24                                                                                                   
     I                               1284 1337  D24                                                                     
     I*** SIZE RUN 25                                                                                                   
     I                               1338 1391  D25                                                                     
     I*** SIZE RUN 26                                                                                                   
     I                               1392 1445  D26                                                                     
     I*** PRIMARY CLASSIFICATION CODE                                                                                   
     I                               1446 1447 0DRCLCD                                                                  
     I*** ADD FLAG FROM PURCHASE ORDER MAINT                                                                            
     I                               1448 1448  DRAFLG                                                                  
     I*** ACCESSORY SIZE RUN                                                                                            
     I                             P 1449 1526  DAC                                                                     
     I                                                                                                                  
     I********* RUN INFORMATION                                                                                         
     I                                                                                                                  
     I*** USER ID                                                                                                       
     I                               1527 1536  DRUSER                                                                  
     I*** RUN DATE                                                                                                      
     I                               1537 1542 0DRDATE                                                                  
     I*** RUN TIME                                                                                                      
     I                               1543 1548 0DRTIME                                                                  
     I*** TRANSACTION #                                                                                                 
     I                               1549 1551 0DRTRN#                                                                  
     I*** DELETE CODE                                                                                                   
     I                               1552 1552  DRDLCD                                                                  
     I*** CASE LOTS Y/N                                                                                                 
     I                               1574 1574  DRCSLT                                                                  
      * DIGRPSTR File                                                                                                   
     IDIGRPS01  NS                                                                                                      
     I*** STOCK NUMBER                                                                                                  
     I                                 19   24 0DSSTCK                                                                  
     I*** GROUP NUMBER                                                                                                  
     I                                 25   27  DSGRP#                                                                  
     I*** STORE NUMBER                                                                                                  
     I                                 28   28  DSN                                                                     
     I                                 28   32  DSSTR#                                                                  
     I*** SIZE RUN SELECTION                                                                                            
     I                                 13   17  DSZRUN                                                                  
     I                                 13   17  srs                                                                     
     I*****************************************************************                                                 
     I* MAINLINE                                                                                                        
     I*****************************************************************                                                 
      *                                                                                                                 
     C     *entry        plist                                                                                          
     C                   parm                    #p0store#                                                              
     C                   parm                    #p0stock#                                                              
     C                   parm                    #p0width                                                               
     C                   parm                    #p0qty                                                                 
     C                   parm                    #p0srary                                                               
     C                   parm                    #p0grp                                                                 
     C                   parm                    #p0srl                                                                 
      *                                                                                                                 
     C                   move      #p0stock#     astock#           6                                                    
     C                   eval      #1 = %subst(astock#:1:1)                                                             
      *                                                                                                                 
     C                   movel(p)  #p0stock#     grprunkey                                                              
     C                   move      #p0grp        grprunkey                                                              
     C     grprunkey     setll     digrprun                                                                             
     C     grprunkey     reade(n)  digrprun                               50                                            
     C                   dow       not *in50                                                                            
      *                                                                                                                 
     C                   if        druncd = 'R'                                                                         
     C                   exsr      getnshstr                                                                            
     C                   leave                                                                                          
     C                   endif                                                                                          
      *                                                                                                                 
     C     grprunkey     reade(n)  digrprun                               50                                            
     C                   enddo                                                                                          
      *                                                                                                                 
     C                   movel(p)  grprunkey     grpstrkey                                                              
     C     grpstrkey     setll     digrps01                                                                             
     C                   read      digrps01                               58                                            
     C                   if        not %found or                                                                        
     C                             dsstck <> #p0stock# or dsgrp# <> #p0grp                                              
     C     grprunkey     chain     digrprun                                                                             
     C                   if        %found                                                                               
     C                   except    delgrprun                                                                            
     C                   endif                                                                                          
     C                   endif                                                                                          
      *                                                                                                                 
     C                   eval      *inlr = *on                                                                          
     C                   return                                                                                         
      *                                                                                                                 
      ********************************************************************                                              
      * Get NSH Store                                                                                                   
      ********************************************************************                                              
     C     getnshstr     begsr                                                                                          
      *                                                                                                                 
     C                   eval      $done = *off                                                                         
     C                   movel(p)  grprunkey     grpstrkey                                                              
     C     grpstrkey     setll     digrps01                                                                             
      *                                                                                                                 
     C                   dou       $done                                                                                
     C                   read      digrps01                               58                                            
      *                                                                                                                 
     C                   if        not %found or                                                                        
     C                             dsstck <> #p0stock# or dsgrp# <> #p0grp                                              
     C                   leave                                                                                          
     C                   end                                                                                            
      *                                                                                                                 
     C                   if        dsn <> 'N'                                                                           
     C                   iter                                                                                           
     C                   end                                                                                            
     C                   if        (dsstr#='N0014') or (dsstr#='N0015')                                                 
     C                   iter                                                                                           
     C                   end                                                                                            
      *                                                                                                                 
     C                   z-add     5             #x                                                                     
     C                   dow       #x > *zero                                                                           
      *                                                                                                                 
     C                   eval      $found = *off                                                                        
     C                   z-add     #x            #y                                                                     
      *                                                                                                                 
     C                   if        srs(#y) = #p0srl                                                                     
     C                   eval      $found = *on                                                                         
     C                   sub       1             #y                                                                     
     C                   if        #y = *zero                                                                           
     C                   add       1             #y                                                                     
     C                   move      *blank        srs(#y)                                                                
     C                   else                                                                                           
     C                   if        srs(#y) >= '1' and srs(#y) <= '9'                                                    
     C                   move      srs(#y)       #lcfactor                                                              
     C                   sub       1             #lcfactor                                                              
     C                   if        #lcfactor = *zero                                                                    
     C                   move      *blank        srs(#y)                                                                
     C                   add       1             #y                                                                     
     C                   move      *blank        srs(#y)                                                                
     C                   else                                                                                           
     C                   move      #lcfactor     srs(#y)                                                                
     C                   add       1             #x                                                                     
     C                   endif                                                                                          
     C                   else                                                                                           
     C                   add       1             #y                                                                     
     C                   move      *blank        srs(#y)                                                                
     C                   endif                                                                                          
     C                   endif                                                                                          
     C                   endif                                                                                          
      *                                                                                                                 
     C                   if        $found                                                                               
     C                   exsr      upd_ap                                                                               
     C                   exsr      wrt_nsaudit                                                                          
     C                   sub       1             #p0qty                                                                 
     C                   if        #p0qty = *zero                                                                       
     C                   eval      $done = *on                                                                          
     C                   leave                                                                                          
     C                   endif                                                                                          
     C                   endif                                                                                          
      *                                                                                                                 
     C                   sub       1             #x                                                                     
     C                   enddo                                                                                          
      *                                                                                                                 
     C                   if        srs(1)=' ' and srs(2)=' ' and srs(3)=' '                                             
     C                             and srs(4)=' ' and srs(5)=' '                                                        
     C                   except    delgrpstr                                                                            
     C                   else                                                                                           
     C                   except    updgrpstr                                                                            
     C                   endif                                                                                          
      *                                                                                                                 
     C                   enddo                                                                                          
      *                                                                                                                 
     C                   endsr                                                                                          
      *                                                                                                                 
      ********************************************************************                                              
      * Update Add-to-Pull                                                                                              
      ********************************************************************                                              
     C     upd_ap        begsr                                                                                          
      *                                                                                                                 
     C                   if        #1 = '6' or #1 = '8' or #1 = '9'                                                     
     C                   eval      #pxqty = #p0srary(1)                                                                 
     C                   else                                                                                           
     C                   z-add     #p0srary      #pxsrary                                                               
     C                   eval      #pxqty = 1                                                                           
     C                   endif                                                                                          
      *                                                                                                                 
     C                   callb     'INU141'                                                                             
     C                   parm      #p0store#     #pxstore#                                                              
     C                   parm      #p0stock#     #pxstock#                                                              
     C                   parm      #p0width      #pxwidth                                                               
     C                   parm      'A'           #pxtype                                                                
     C                   parm                    #pxqty                                                                 
     C                   parm      #p0srary      #pxsrary                                                               
     C                   parm      'N'           #pxupdwhs                                                              
      *                                                                                                                 
     C                   endsr                                                                                          
      *                                                                                                                 
      ********************************************************************                                              
      * Write N/S Audit Record                                                                                          
      ********************************************************************                                              
     C     wrt_nsaudit   begsr                                                                                          
      *                                                                                                                 
     C                   open      nsaudit                              99                                              
      *                                                                                                                 
     C                   z-add     #p0store#     nsstr#                                                                 
     C                   z-add     #p0stock#     nsstck#                                                                
     C                   move      #p0width      nswdth                                                                 
     C                   movel     #lcusr        nsuser                                                                 
     C                   movel     dateiso       nsdate                                                                 
     C                   time                    nstime                                                                 
     C                   write     nsauditr                                                                             
      *                                                                                                                 
     C                   close     nsaudit                              99                                              
      *                                                                                                                 
     C                   endsr                                                                                          
      *                                                                                                                 
     Odigrprun  edel         delgrprun                                                                                  
     Odigrps01  edel         delgrpstr                                                                                  
     Odigrps01  e            updgrpstr                                                                                  
     O                       srs                 17                                                                     

PHP Toolkit Call of Program 2 (which is NOT working)

Code: Select all

//Initialize Toolkit Variables
$param = '';

//Set Toolkit Parameter Array		
$param[] = $this->Toolkit->AddParameterZoned('both', 5, 0, 'Store #', 'STORE', str_pad($this->getStore(), 5, '0', STR_PAD_LEFT));
$param[] = $this->Toolkit->AddParameterZoned('both', 6, 0, 'Stock #', 'STOCK', str_pad($this->getStock(), 6, '0', STR_PAD_LEFT));
$param[] = $this->Toolkit->AddParameterZoned('both', 1, 0, 'Width', 'WIDTH', $this->getWidth());
$param[] = $this->Toolkit->AddParameterZoned('in', 5, 0, 'Total', 'TOTAL', $qty);
$param[] = $this->Toolkit->AddParameterChar('in', 3, 'Group', 'GROUP', $group);
for($i = 0; $i < count($run); $i++) {
	$padded = str_pad($i + 1, 2, '0', STR_PAD_LEFT);
	$param[] = $this->Toolkit->AddParameterZoned('in', 3, 0, 'Size ' . $padded, 'SIZE' . $padded, $run[$i]);
};	
$param[] = $this->Toolkit->AddParameterChar('in', 1, 'Size Run Letter', 'SRLET', $letter);

//Calls Program
$servPgmResult = $this->Toolkit->PgmCall('INU143', $this->managementDB, $param, null, null);

//Check Toolkit Results
if($servPgmResult) {
	
	$status = true;
	
} else {
	
	$errorMessage = "Program failed.";
	
};

I don't know if it is of note or not, but we did test moving the last parameter of Toolkit Call for Program 2 above the FOR loop of Zoned Values. This made the program successfully run but the actual data was wrong. Any help would be appreciated. Thanks.
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: Toolkit Failure

Post by scottgcampbell » Tue May 03, 2016 2:03 pm

Have you tried moving the Group parm below the size? That is the way they are defined in the program.

Scott

Code: Select all

$param[] = $this->Toolkit->AddParameterZoned('both', 5, 0, 'Store #', 'STORE', str_pad($this->getStore(), 5, '0', STR_PAD_LEFT));
$param[] = $this->Toolkit->AddParameterZoned('both', 6, 0, 'Stock #', 'STOCK', str_pad($this->getStock(), 6, '0', STR_PAD_LEFT));
$param[] = $this->Toolkit->AddParameterZoned('both', 1, 0, 'Width', 'WIDTH', $this->getWidth());
$param[] = $this->Toolkit->AddParameterZoned('in', 5, 0, 'Total', 'TOTAL', $qty);
$param[] = $this->Toolkit->AddParameterChar('in', 3, 'Group', 'GROUP', $group);
for($i = 0; $i < count($run); $i++) {
   $padded = str_pad($i + 1, 2, '0', STR_PAD_LEFT);
   $param[] = $this->Toolkit->AddParameterZoned('in', 3, 0, 'Size ' . $padded, 'SIZE' . $padded, $run[$i]);
};   
$param[] = $this->Toolkit->AddParameterChar('in', 1, 'Size Run Letter', 'SRLET', $letter);

Code: Select all

     C     *entry        plist                                                                                          
     C                   parm                    #p0store#                                                              
     C                   parm                    #p0stock#                                                              
     C                   parm                    #p0width                                                               
     C                   parm                    #p0qty                                                                 
     C                   parm                    #p0srary                                                               
     C                   parm                    #p0grp                                                                 
     C                   parm                    #p0srl            

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: Toolkit Failure

Post by jord1322 » Tue May 10, 2016 4:39 pm

Thanks Scott. That did not turn out to be the problem, but it was an ordering problem. Thanks though for the help, it got us going in the right direction to a much quicker resolution.
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

Post Reply