[USflag] The American Programmer [USflag]


Home
Books on Mainframe Programming
Mainframe Manuals and Tutorials
System Abend codes, Sqlcodes, VSAM/QSAM codes
Everything about the IBM AS/400 Midrange Computer
Everything about CICS
Everything about COBOL
Everything about DB2 and SQL
  DB2/SQL Singleton Select embedded in a COBOL program
  DB2/SQL Add Change Delete program
  DB2/SQL program to read table with cursor
  DB2/SQL load table program
  DB2/SQL program to read a table randomly
  DB2/SQL bare bones skeleton program
  DB2/SQL program to insert a row into a table
  DB2/SQL program to update a row
  DB2/SQL program for handling variable length column
  DB2/SQL program for handling column with null indicator
  Embedded SQL. Short tutorial.
  Examples of DCLGEN. Short tutorial.
  Examples of SQL Joins. Short tutorial.
  Examples of DB2 View. Short tutorial.
  Just Enough SQL/QMF/SPUFI To Be Dangerous
  Sample tables STAFF, ORG, EMP and DEPT
  QMF Procedures Written in REXX
  Using REXX Subroutines with the QMF Calc panel
  Using QMF to Execute Your SQL
  QMF Cheat Sheet. Edit codes. QMF Commands, Text Variables, Usage Codes
  Executing SQL in a batch job
  Using Spufi to Execute Your SQL
  Books on DB2 and SQL
  DB2 and SQL, Structured Query Language manuals
  SQLCODES and Their Causes
Everything about IMS
Everything about Java and JavaScript
Everything about JCL and JES
Everything about REXX
Everything about zOS, VSAM, Tivoli, Assembler
Everything about TSO, ISPF, Spufi
Site Map and Site Search

           Home   > DB2   > Using QMF to Execute Your SQL

Using QMF to Execute Your SQL

You want to run some structured query language to access data that is on DB2. Your company has the IBM product QMF installed.

   Get into QMF. Each company has its own way of getting into QMF. 

Find out how your company wants you to enter QMF.
______________________________________________________________________________ IBM* * Trademark of International Business Machines ______________________________________________________________________________ QMF HOME PANEL Version 3 Release 0.0 Z ****** ** ** ********* ** ** *** *** ** Query ** ** **** **** ******* Management ** ** ** ** ** ** ** Facility ** * ** ** **** ** ** ****** ** ** ** ** ________________________________________ Type command on command line or use PF keys. For help, press PF1 or type HELP. ______________________________________________________________________________ 1=Help 2=List 3=End 4=Show 5=Chart 6=Query 7=Retrieve 8=Edit Table 9=Form 10=Proc 11=Profile 12=Report Press PF6 to get into the query panel
SQL QUERY LINE 1 *** END *** 1=Help 2=Run 3=End 4=Print 5=Chart 6=Draw 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report QUERY is displayed. COMMAND SCROLL Tab twice Type in the SQL query
SQL QUERY LINE 1 select * from q.staff *** END *** 1=Help 2=Run 3=End 4=Print 5=Chart 6=Draw 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report OK, QUERY is displayed. COMMAND SCROLL ===> PAGE Press F2 to execute the SQL query
REPORT LINE 1 POS 1 79 ID NAME DEPT JOB YEARS SALARY COMM ------ --------- ------ ----- ------ ---------- ---------- 10 SANDERS 20 MGR 7 18357.50 - 20 PERNAL 20 SALES 8 18171.25 612.45 30 MARENGHI 38 MGR 5 17506.75 - 40 O'BRIEN 38 SALES 6 18006.00 846.55 50 HANES 15 MGR 10 20659.80 - 60 QUIGLEY 38 SALES - 16808.30 650.25 70 ROTHMAN 15 SALES 7 16502.83 1152.00 80 JAMES 20 CLERK - 13504.60 128.20 90 KOONITZ 42 SALES 6 18001.75 1386.70 100 PLOTZ 42 MGR 7 18352.80 - 110 NGAN 15 CLERK 5 12508.20 206.60 120 NAUGHTON 38 CLERK - 12954.75 180.00 130 YAMAGUCHI 42 CLERK 6 10505.90 75.60 140 FRAYE 51 MGR 6 21150.00 - 1=Help 2= 3=End 4=Print 5=Chart 6=Query 7=Backward 8=Forward 9=Form 10=Left 11=Right 12= OK, this is the REPORT from your RUN command. COMMAND SCROLL ===> PAGE Press PF6 to get back into the query panel
Useful things you can do with QMF Giving yourself a copy of a table that you can INSERT/UPDATE/DELETE (Not all companies will let you do this)
SQL QUERY LINE 1 *** END *** 1=Help 2=Run 3=End 4=Print 5=Chart 6=Draw 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report OK, QUERY is displayed. COMMAND SCROLL ===> PAGE Type on the command line: (one line at a time, pressing ENTER after each line) RESET QUERY DISPLAY table-name for example: STAFF SAVE DATA AS table-name qualified with your Userid for example: Userid.STAFF You now have a table that you own. You can practice modifying it without affecting anyone else.

[Books Computer]

Home Books for Computer Professionals Privacy Terms |
Site Map and Site Search Programming Manuals and Tutorials The REXX Files Top of Page |