Want Query output into Spool file

100 pts.
Tags:
CLLE
RUNQRY
Spool file
Hello Folks

I am creating utility CLLE program based on 5 options.

Inital 4 options will be RUNQRY (query name and library is fix). Queries I have already created by WRKQRY via joining various (4-5) files. 5th option is for to check spool file.

Now I want to make a program that first displays the output to the user and when user presses enter the displayed output will be directed to the spool file that if user wants to check he can take option 5

Can anybody suggest set of command to perform this activity.

Appreciate your quick response at topankajmahajan@yahoo.com or at my cell no +91-9923696220

thanks n Regards

Pankaj mahajan

India Pune

 

 

 

Answer Wiki

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

Please find more details on my question :-

I have made 4 qureies by WRKQRY command and in each query 4-5 database files have been joined

Now What I have :-

Four queries :-
1) PAN1
2) PAN2
3) PAN3
4) PAN4

I have saved in my library Say LIB1

Now I am developing a CLLE program in which based on input of display file:-

if user takes option 1, Query Pan1 will be execute from library LIB1
and if the user takes option 2 , Query Pan2 will be execute from same library LIB1..and so on. And 5th option is for spool file to see resulted output in the query

What I am trying is:-
IF COND(&S1OPTN = ’1′) THEN(DO)
RUNQRY QRY(LIB1/Pan1) OUTTYPE(*DISPLAY) +
OUTFORM(*DETAIL)
/* CHGSPLFA FILE(QPQUPRFIL) SPLNBR(*LAST) SAVE(*YES) */
CHGVAR VAR(&S1OPTN) VALUE(‘ ‘)
SNDRCVF DEV(*FILE) RCDFMT(IBPRF)
ENDDO
ENDDO

here PAN1 is query in my library LIB1. I want first display to the user then after user presses enter all the displayed out directed to the spool file that the user should able to view by option 5.

Discuss This Question: 2  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
  • Splat
    Are you asking if there is some system-supplied program or programs that will do what you need done?
    6,765 pointsBadges:
    report
  • TomLiotta
    You would use the RUNQRY command to display the query output. Then you would use RUNQRY again to generate the spooled output. Or you could use RUNQRY always to create spooled output. You would then use DSPSPLF to display the spooled file. After displaying the spooled file, your program would need a way to choose to delete the spooled file or to leave it for the user to do with as they wanted. I'm not sure what the actual problem is. (And I'm not sure why WRKQRY is even being used. It should be abandoned.) Tom
    125,585 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