Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, i have a small problem. i have

Status
Not open for further replies.

samtg

Programmer
Jul 22, 2003
8
MA
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
 
Hi,
I hope following solution will help you..

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


I hope you got your answer.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top