Questions about formatting Progress data.

Mark123

New Member
Hi all,

My questions probably sound too primitive, but I am relatively new to Progress and I found some problems while deveoping 4GL code for it.

Generally speaking, I am creating a dump file from a Progress table with pipe-separated columns.

Here is what I am doing:

for each prospect:
display
prosp_id "|"
name "|"
address "|"
city + state "|"
zip
skip.
end

But the result does not look as I expected.

First, how to eliminate trailing spaces between data and pipe-sign ?
And second, as you can see from my code snippet, I am concatenating two fields. Unfortunately, Progress displays only first 8 characters. So how to code it to display it all ?

Note: same thing occurs if I replace DISPLAY with PUT statement.

Thanks
 

gnome

Member
I suggest you have to concatenate variables with your pipes sign to remove trailing spaces or with combination of trim() function if your not really that confident with your data.

If the progress doesnot display the entire string to an output file, you can format the string: (see code).


Code:
define variable c_rowdata as character no-undo.
 
for each prospect:
assign c_rowdata = trim(prosp_id) + "|" + trim(name) + "|" +  trim(address) + "|" + trim(city) + "|" + trim(state) + "|" + trim(zip). 
display c_rowdata format 'x(300)' skip.
end
 

TomBascom

Curmudgeon
The Progress DISPLAY statement is formatting your data to match the defined FORMAT in the data dictionary. The calculated field is using the default character FORMAT of "x(8)".

As has been mentioned you could use PUT UNFORMATTED or EXPORT to get the output that you want.
 

leite1969

New Member
for each prospect:

export delimiter "|" prospect. /*** Todos os campos da tabela ****/

end.


or


for each prospect:

export delimiter "|" prospect.prosp_id prospect.name prospect.address prospect.city prospect.state prospect.zip /*** Somente alguns campos da tabela ****/

end.
 
Top