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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting from QMF

Status
Not open for further replies.

txdave35

Technical User
Nov 20, 2008
122
US
Hi Everyone,

I have a query result set in the QMF that I need to bring into Access. When I use the Export command and create a txt file, DB2 inserts a lot of garbage numbers and my columns wrap around and run together. I can't import the file because Access doesn't know where one column truly ends and the other begins.

Is there some way to prevent this wrapping problem? I've tried doing a find and replace with blank on the garbage numbers, but with 40,000 lines, this will take a long time.
 
Hi Dave,
There are two ways to do this:
1) Export the report (rather than the data). This will give you a dataset with a load of QMF garbage on the first 8 lines or so and last 3 lines which you can delete. You will then need to shift the whole dataset 18 chars left (done with ((18 on the first and last lines of the dataset).

2) Once you are in QMF, shell out to ISPF and issue the FREE F(DSQPRINT) command. Physically allocate a dataset that is big enough for your report and then issue the command ALLOC f(DSQPRINT) DS(you.ds.name) SHR and then drop back in QMF. You can now issue the QMF command PRINT REPORT (PRINTER='' L=CONT
This will print the report to the dataset allocated to the DSQPRINT ddname. The L=CONT bit stops QMF from putting headings on every page!

That said, the easiest way of all is to access the DB2 tables direct from Access using ODBC. This is a really easy way of getting data into Access from a DB2 mainframe table, but it depends whether your site allows access to DB2 tables in this way.

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top