Hi,
i have a small problem. i have an array that contains n columns and i want to write the content of this array to a file with a pipe separator without using report.
Thanks a lot
If you do not want to write a report, then
either;
A> you create a TEMP table and load everything that
you have in ARRAY into the temp table. Once you
done with loading data into temp table, you can
execute following command
unload to 'file_name.unl' select * from temp_table
OR
B> you need to write following in your 4gl
for i to max_arr_size
let lv_str = arr_col.col1 clipped, '|',
arr_col.col2 clipped, '|',
-----
-----
arr_col.coln clipped. '|'
let lv_run_str = " echo ' ", lv_str clipped, "' >> file_name "
RUN lv_run_str
end for
## Remember lv_str should be defined with enough
## space to hold all the values from arr_col and
## the same rules appiles to lv_run_str
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.