Midrange News for the IBM i Community


Posted by: Chris Proctor
Programmer Analyst
Columbia Sports Company
Portland, OR
Parms running together
has no ratings.
Published: 27 Feb 2014
Revised: 28 Feb 2014 - 1748 days ago
Last viewed on: 11 Dec 2018 (3168 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Parms running together Published by: Chris Proctor on 27 Feb 2014 view comments(6)

Can someone tell me why this happens? I have a program that receives 4 parms. If I call it from a command line, if it's a character parm, I'm not worrying about specifying the entire length of the parm. However, when I look at it in debug, I could have two or more parm values showing in a single parm field. For example, I'm calling this program from the command line:

call altseqtst ('411' 'test@austin.rr.com' 'Bob' 'Cozzi')

My input parms are defined with the following in the program:

d test            pr                  extpgm('ALTSEQTST')  
d pstore                         3a                        
d pemail                        50a                        
d pfname                        50a                        
d plname                        50a                        
                                                           
d test            pi                                       
d pstore                         3a                        
d pemail                        50a                        
d pfname                        50a                        
d plname                        50a                        

Because the email address I entered is shorter than the 50a specified, it appears the first name is being appended to the email parm. I should also say that the field below is what the pemail parm is being copied into for the key list. This is what the field looks like:

> EVAL ademl1                                                            
  ADEML1 =                                                               
            ....5...10...15...20...25...30...35...40...45...50...55...60 
       1   'test@austin.rr.com             Nancy                      '
      61   '                                                            '
     121   '                                                            '
     181   '                                                            '
     241   '              '                                              

I'm sure someone can explain this. I'm sure if I accounted for all 50 characters when I called the program I would have had this issue, but is there a way of getting around it?

Thanks!

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS