• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • A Better Way to Get Query/400 Definitions?

    May 31, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I am writing in response to your article, “Print Query Defintions from a Batch Job” that was published in the May 22 issue of Midrange Guru, OS/400 Edition.

    ASC

    A better solution is to use the Retrieve Query Management Query (RTVQMQRY) command, which works fine for a Query/400 definition (*QRYDFN object).

    This puts the output into a source file that can be manipulated with a program.

    See the following example:

    PGM        PARM(&LIBRARY)
    
       DCL        VAR(&LIBRARY) TYPE(*CHAR) LEN(10)
       DCLF       FILE(DSPOBJD)
    
       CLRPFM     FILE(RTVQRYOUT)
       DSPOBJD    OBJ(&LIBRARY/*ALL) +
          OBJTYPE(*QRYDFN) +
          OUTPUT(*OUTFILE) +
          OUTFILE(QTEMP/DSPOBJD)
       OVRDBF     FILE(QTXTSRC) +
          TOFILE(QGPL/QTXTSRC) +
          MBR(RTVQRYTMP)
    LOOP:
       RCVF       
    …

    Read more
  • Odds and Ends

    May 31, 2002 Timothy Prickett Morgan

    Dear Readers:

    As requested, here are more short tips that don’t qualify as tips in their own right, for whatever reasons. I hope you find something useful.

    ASC

    — Ted

    Question:

    Is it possible for an initial program to determine if the user who is running it is already signed on with another session?

    Answer:

    Yes, attempt to allocate an object with an exclusive lock. If the user is already signed on elsewhere, the allocation should fail.

    Here is some example code to get you started.

       DCL   &USER        *CHAR     10                 
       DCL   &LIB         *CHAR     10  VALUE(QGPL)
    
       MONMSG     MSGID(CPF0000) EXEC(GOTO ENDPGM)
    
       RTVUSRPRF  
    …

    Read more
  • Using Library Lists for JDBC File Access

    May 31, 2002 Timothy Prickett Morgan

    Hey, David:

    How do you set your library list with JDBC and JTOpen? The JDBC documentation says that I should use system naming along with a libraries property. When I do that, it appears that the search stops on the first library. The only way I can get a select statement that uses files from more than one library is to qualify the library name. That makes it difficult to test.

    BCD Int'l

    — James

    To be consistent with the way that the ODBC uses library names, the JTOpen 3.0 JDBC drivers take the first library that you specify and ignore the

    …

    Read more

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle