• 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

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

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