Laks143,
Whenever I want to do this, I work with tab delimited text. Since a tab is equal to a hex '05', you can easily incorporate that into your output. Below is an example where I am reading in an Excel spreadsheet, saved as tab delimited text. I'm then creating a new column, and writing the new rows back out to the same file. The new file can then be opened from Excel, and the import wizard can parse out the columns using the tabs.
Hope this helps!
Karl
/**************************** REXX **********************************/
/* CODE TO READ IN A TAB DELIMITED TEXT FILE, ADD A NEW COLUMN, AND */
/* WRITE THE RESULTS TO THE SAME FILE, AS TAB DELIMITED TEXT. THIS */
/* FILE CAN THEN BE IMPORTED TO AN EXCEL SPREADSHEET. */
/**********************************************************************/
"ALLOCATE F(INFILE) DA('USER.EXCEL.TEXT') SHR"
"EXECIO * DISKR INFILE (STEM LINEIN. FINIS"
"FREE F(INFILE)"
DO A = 1 TO LINEIN.0
PARSE VAR LINEIN.A COL_A '05'X,
COL_B '05'X,
COL_C '05'X,
COL_D '05'X,
COL_E '05'X
/* MAKE NEW COLUMN. */
COL_F = COL_A||'+'||COL_B||'+'||COL_E
/* BUILD NEW ROWS FOR NEW SPREADSHEET. */
LINEOUT.A = COL_A||'05'X||,
COL_B||'05'X||,
COL_C||'05'X||,
COL_D||'05'X||,
COL_E||'05'X||,
COL_F||'05'X
END
"ALLOCATE F(OUTFILE) DA('USER.EXCEL.TEXT') OLD"
"EXECIO * DISKW OUTFILE (STEM LINEOUT. FINIS"
"FREE F(OUTFILE)"
If you know what the data looks like you can use the rexx ole class (granted I am using OOREXX). Add a Requires OREXXXOLS.cls
http://www.rexxla.org/events/2004/ronyf1.pdf
Hi everybody,
I used to build files on MVS for excel purposes.
I use the same method, that, the one of Laks143.
I prefer to user the character comma.
It is recognized by EXCEL, and visiually speaking it’s more readable.
And you have not some problems of versions EBCDIC to ASCII.
Regards.
Hi,