× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Greg,

This is one of the oldies but goodies....  Your problem comes from the command 
line parser that's used to process the submitted command string.  The parser 
has to figure out what your parm data looks like from the command string, then 
map that data to storage that can be accessed (by reference) from the rpg 
program.  The problem arises that the command parser has no way to determine 
how big those parms are SUPPOSED to be....  

By default, the command parser will declare memory for parameters using a 
default size.  Character fields are 32 bytes, and numeric data is 15p5.  In the 
case of character data, if the parser SEES more than 32 bytes of continuous 
parameter data, then it will increase the size of the parameter storage to 
equal the TRIMMED LENGTH of the actual data.  If you pass a lot of blanks at 
the end of a long character parm, then you'll have problems reading that field 
in RPG. 

The preferred means of dealing with this would be to create a command (*CMD) 
object that can tell the command line parser how to format storage for your 
program.  This CMD object would be used whenever you call the program from the 
command line, or when submitting the program.

Another trick is to declare your variables in the CL submitter to have one 
extra byte, then force a non-blank character into that extra byte.  This tricks 
the command analyzer into declaring enough memory so that your program can 
access all of its bytes safely.  Note that you only need to do this for fields 
larger than 32 bytes.... 

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-297-2863 or ext. 1863



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Fleming, Greg (ED)
Sent: Friday, June 23, 2006 3:47 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Parameters Stepping on each other


This is weird.  We have a CL submitting an RPG.  When we debug, the
parameters look fine in the CL, but they seem to be stepping on each
other when we look at them in the RPG.

Here's some code snippets:

DCL        VAR(&PUSERID10) TYPE(*CHAR) LEN(10) 

DCL        VAR(&PASSWRD10) TYPE(*CHAR) LEN(10) 

DCL        VAR(&PIPADDRS) TYPE(*CHAR) LEN(48) 

DCL        VAR(&PFMDIR) TYPE(*CHAR) LEN(256) 

DCL        VAR(&PTODIR) TYPE(*CHAR) LEN(256)

DCL        VAR(&PFILENAME) TYPE(*CHAR) LEN(50)

DCL        VAR(&PPRODTYPE) TYPE(*CHAR) LEN(1) 

SBMJOB     CMD(CALL PGM(FF407AR) PARM(&PUSERID10 +

                          &PASSWRD10 &PIPADDRS &PFMDIR &PTODIR +

                          &PFILENAME &PPRODTYPE)) JOB(FTP_PC2PC) +

 JOBQ(QBATCH2) HOLD(*NO) 

------------------------------------------------------------------------
---------------------------------------

D $Entry_Parms    Pr                  ExtPgm('FF407AR')

D  Pr_UserId                    10A                    

D  Pr_UserPwrd                  10A                    

D  Pr_IPAddress                 48A                    

D  Pr_FrmDir                   256A                    

D  Pr_ToDir                    256A                    

D  Pr_FileName                  50A                    

D  Pr_ProductType...                                   

D                                1A                    

 *                                                     

D $Entry_Parms    Pi                                   

D  P_UserId                     10A                    

D  P_UserPwrd                   10A                    

D  P_IPAddress                  48A                    

D  P_FrmDir                    256A                    

D  P_ToDir                     256A                    

D  P_FileName                   50A                    

D  P_ProductType...                                    

D                                1A

 

The first two parms look OK in the RPG, but the IPAddress has the first
five chars of the FrmDir tacked onto the end, and all the subsequent
parms are likewise including the ones after them, except the last one,
which is correct.  

Any ideas ?  

Thanks

 

Greg Fleming

Programmer/Analyst

Everglades Direct, Inc.

 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.