Bradskk
0 pts. | Jul 13 2005 1:10PM GMT
As far as the unwanted spaces - use the one of the trim functions to remove them as you are building the output
WaltZ400
535 pts. | Jul 13 2005 1:13PM GMT
What I would do is first intialize all array elements to *HIVAL. For a 3 character field this would place values of hex FFFFFF in each.
Next to load the array do a lookup with the value you want to place in the array element. If no entry is found do a lookup using *HIVAL to find the first available blank entry and load the data into it with the EVALR operation code. This loads the array element and right justifies the data so a value of ‘ 12′ will be stored this way.
Once you get all values loaded into the array, do a SORTA operation on the array. This sorts the array in ascending sequence as a default and since any blank entries will still have *HIVAL in them these will be at the end of the array when done.
Then do a DO loop to run through the array and end your processing when you hit the first *HIVAL entry.
Hope this helps.
TomLiotta
7990 pts. | Oct 29 2009 6:29AM GMT
Your question leaves out far too much info to give a decent answer. What OS version/release are you working with? Do you have 53 3-char variables plus six 2-char variables? …or do you have 59 3-char variables with six of them only having values two chars wide? If you have 53 3-char variables, can they have blanks in them? (Trailing blanks?) Are these all separate variables or do you have them in an array? Do these print with spaces between them or are they concatenated together? Are they all printed on a single line? How wide is your print line?
Can you give an example of maybe half a dozen 3-char variables and three 2-char variables, with their values, and show what the expected output should look like?
Tom






