MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

execute db2 queries from TSO

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
syandra
Beginner


Joined: 26 May 2003
Posts: 19
Topics: 6

PostPosted: Mon May 26, 2003 3:16 am    Post subject: execute db2 queries from TSO Reply with quote

Hi all,

Can we execute DB2 queries from the TSO.
PLease let me know all the possibilities.

Thanks,
Sukumar
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon May 26, 2003 4:06 am    Post subject: Reply with quote

Sukumar,

The following job would execute a query from a batch job

Code:

//STEP   EXEC PGM=IKJEFT01
//SYSTSIN     DD *
  DSN  SYSTEM(DSN)
  RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2)
//SYSTSPRT    DD SYSOUT=*
//SYSPRINT    DD SYSOUT=*
//DSNTRACE    DD SYSOUT=*
//SYSIN       DD *
  YOUR.QUERY.GOES.HERE
/*
//


Hope this helps...

Cheers,
Coolman.
________
NSR50R


Last edited by coolman on Sat Feb 05, 2011 1:21 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon May 26, 2003 9:55 am    Post subject: Reply with quote

syandra,

You can also use DSNTIAUL.check this link for explanation and examples of DSNTIAUL.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAPH11/APPENDIX1.3.1?DT=20010710165542

Interactively , you can use SPUFI , QMF , PRO-EDIT to execuete your db2 queries.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
syandra
Beginner


Joined: 26 May 2003
Posts: 19
Topics: 6

PostPosted: Tue May 27, 2003 12:57 am    Post subject: Reply with quote

Can we run DB2 queries from the TSO command line
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue May 27, 2003 5:20 am    Post subject: Reply with quote

syandra,
You can code an REXX exec which will access DB2. you can put all your queries in the EXEC and run it from the TSO command line.

Check this link for examples.

ftp://ftp.software.ibm.com/software/os390/db2server/books/REXXV5.PDF

Hope this helps....

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed May 28, 2003 1:58 am    Post subject: Reply with quote

Kolusu,
Iam not able to access the link you had provided.

Syandra,
Answering your question, just try this :

1.Go to command shell (option 6)
2.Type TSO DSN
3. Now Type this
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2)
4. You would have a : prompt
5. Now, type your query there and press Enter
6. You would be greeted with +: prompt
7. Now press space bar (or any other characters), and complete that line
8. When you press an Enter, you would get the Result of your query (online)

Kolusu,
This is where I have a question. How do you replace step7. I tried "end,exit,quit" (allmost everything), but not able to find a way to terminate the program

Any suggestions...

Hope this helps...

Cheers,
Coolman.
________
marijuana dispensary


Last edited by coolman on Sat Feb 05, 2011 1:23 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed May 28, 2003 5:18 am    Post subject: Reply with quote

coolman,

I have no problems accessing the above posted link. Do you have acrobat reader on your system?If you do not have then you can download the reader from the net. It is free. The link points to a PDF file and if you are on a dial up connection it will take a while for the link to open.

Coming to your other query, my shop has restricted the usage of DB2 utility programs via TSO. so I cannot simulate your problem. sorry about that.

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group