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!

spooling results of db2 sql via QMF 2

Status
Not open for further replies.

gotmilk2

Programmer
Jan 24, 2006
10
US
How can I save/spool the results of SQL submitted via QMF to a file (text or flat, does not matter)?
 
There's a couple of ways to do this, which depending on the size of the output, you may wish to choose.....

1) From within QMF issue the command:
EXPORT REPORT TO 'USERID.TEMP.DATA'
You will then need to drop into EDIT, delete the first 12 or so lines of QMF control data, and the last 3 also, and shift the whole dataset 18 characters to the left.

You will then have the data that you saw on your QMF panel in the dataset of your choice.

2) If the data is too large to edit in the fashion above, then you need to print it to a dataset. Follow these steps:
a) From outside of QMF allocate a dataset large enough in terms of tracks and cylinders and wide enough (LRECL) for your report.
b) Go into QMF and generate your report.
c) Type ISPF on the QMF command line
d) Go to Option 6 (TSO)
e) Issue the command FREE DD(DSQPRINT)
f) Issue the command ALLOC DD(DSQPRINT) DS('userid.dataset.name') SHR putting in the correct dataset name allocated in a)
g) Type =X
h) From within QMF issue the command PRINT REPORT ( PRINTER='' L=CONT

This will put the output from QMF into your predefined dataset.

Hope this helps

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top