How can I export data from mainframe to Excel in REXX

5 pts.
Tags:
Mainframe
Microsoft Excel
Microsoft Excel import/export
REXX
REXX Procedure
REXX procedure to export data to Excel
i want to export data in PS to excel through rexx code.As i am a beginner in REXX .can any one help me in this .

Answer Wiki

Thanks. We'll let you know when a new response is added.

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)”

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Tcpipman
    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
    10 pointsBadges:
    report
  • Abenmouss
    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.
    25 pointsBadges:
    report
  • Allocateexcelsheet
    Hi,
    Can u please tell how & where to allocate the excel sheet?? 
    I mean USER.EXCEL.TEXT is it a PS???
    How will it pick from the desktop??
    10 pointsBadges:
    report
  • jobey99
    I write my REXX in this fashion.  First, allocate and write out to the flat file (PS) CSV files out using any character, usually a pipe |.  Make sure to FREE the file after you write to it.  Then I write JCL to another flat file (PS) which does a file transfer using CFI or NDM or FTP.  Then I submit it via REXX. 
    65 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following