• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Confirm File Deletions in Qshell

    August 2, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I accidentally deleted a file in Qshell. I know about the -i option for the rm command, but I forget to use it. Is there any way I can make the -i option the default setting?

    — Lynn

    Use an alias, Lynn. An alias is an alternate name for a command string.

    Add the following line to the .profile file in your home directory.

    alias rm='rm -i'
    

    If you want to change the default for all users, edit /etc/profile instead.

    When you run the rm command, Qshell will substitute rm -i for the rm you type. You will

    …

    Read more
  • Retrieving Query Definitions

    July 31, 2002 Timothy Prickett Morgan

    Hey, Ted:

    You mentioned in your article, “Print Query Definitions from a Batch Job,” in the May 22 issue of Midrange Guru, OS/400 Edition, a way of getting print definitions of Query/400 queries by using a process of RUNQRY and PRTDEF(*YES). This method didn’t help me much; I had too many queries and that meant too much processing time. I had to resort to manually printing the query definitions to an output queue, typing option 6s while in WRKQRY for each library. I was about to do the same for Query Management queries but I found the

    …

    Read more
  • SQL Understands Microseconds

    July 31, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I am writing regarding your article, “Using Timestamps as Unique Keys ,” which printed on July 17 in Midrange Guru, OS/400 Edition. I would like to add the following option for consideration.

    Although the timestamp microsecond value returned by the TIME operation code is only accurate to three positions, SQL’s current timestamp register returns a value accurate to six positions.

    To verify this assumption, I created the following simple SQLRPGLE program:

    D timestamp1      s               z
    D timestamp2      s               z
    
    C                   time                    timestamp1
    C/exec sql
    C+ set :timestamp2 = current timestamp
    C/end-exec
    C
    C                   eval      *inlr = 
    …

    Read more
  • Changing Languages on a 5250 Screen

    July 31, 2002 Timothy Prickett Morgan

    Hey, Joe:

    I do technical support for a country in South America, where the AS/400’s primary language is 2931 (Spanish). But when I telnet over to do tech support, I want my screens to display in language code 2924 (English), which is installed on the machine as a secondary language. Is it possible to change my PC5250 screens to display English?

    — Alex

    It’s possible to change a user session’s PC5250 screen to display in any installed secondary language by adding a language library to the first position in the system part of the user’s library list. By default, your

    …

    Read more
  • Generating a Unique Identifier

    July 26, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I just read your article, “Using Timestamps as Unique Keys,” in the July 17 issue of Midrange Guru, OS/400 Edition.

    There might be a better way of creating a unique ID, one that doesn’t require retries. It’s the GENUUID API and/or MI built-in.

    Universal Unique Identifier (UUID) is supposed be a totally unique ID, even across all the machines in the entire world. I’m assuming that in reality this is 100 percent true, but I wouldn’t worry about it.

    Here’s some code that I’ve had stashed away:

    H option(*NoSrcStmt) DftActGrp(*No)                       
                                                                   
    D UUIDTemplate    ds                                          
    D   BytesProv                   10u 
    …

    Read more
  • Restore a Single IFS Directory

    July 26, 2002 Timothy Prickett Morgan

    Hey, Joe:

    I backed up my entire Integrated File System (IFS) using option 21 (Entire System) from the GO SAVE menu. Now I want to restore just one IFS directory called /test1, not the entire IFS.

    How do I do it?

    — Alex

    The answer here is to use OS/400’s Restore (RST) command. This is a fairly easy command to run, but there are one or two quirks to watch out for as you do it. Here’s my drill for restoring a single directory to the IFS.

    First, put the tape (or tapes) from the full system backup containing the

    …

    Read more
  • Sending Escape Messages from RPG

    July 26, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I know how to use the Send Program Message (SNDPGMMSG) command to send an escape message from a CL program to its caller.

    How do I send an escape message from an RPG program?

    — Len

    Use the Send Program Message API, QMHSNDPM.

    Here’s an example:

    D SendEscMsg      pr                  extpgm('QMHSNDPM')
    D   MsgID                        7    const             
    D   MsgFile                     20    const             
    D   MsgDta                      80    const             
    D   MsgDtaLen                   10i 0 const             
    D   MsgType                     10    const             
    D   MsgQ                        10    const             
    D   MsgQNbr                     10i 0 const             
    D   MsgKey                       4                      
    D   ErrorDS                     16                      
                                                            
    D ErrorDS         ds            16                      
    D   BytesProv                   10i 0 inz(16)           
    D   BytesAvail                  10i 
    …

    Read more
  • Scheduling a Job to Run More than Once a Day

    July 24, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I saw your tip in the July 12 issue of Midrange Guru, OS/400 Edition.

    I’ve done this for few clients by simply posting multiple entries in the job schedule under slightly different job names. If you have to change the job schedule entries frequently, this might not be such a good idea; my experience has been that once a job is in the scheduler, it rarely changes. I did this for a direct mail company that was running mailing list selections five times a day. Five entries to the job scheduler took care of it nicely.

    …

    Read more
  • Three Ways to Direct OS/400 Output Queues to TCP/IP Printers

    July 24, 2002 Timothy Prickett Morgan

    Dear Readers:

    In shops with TCP/IP networks, a common task is to redirect OS/400 printer output to a TCP/IP printer sitting somewhere else on your network. While the easiest way to configure the printer is by hard coding the IP address inside the printer output queue configuration, that’s not the only way to do it. In fact, there are three different ways to configure an OS/400 TCP/IP remote output queue that I’d like to share with you.

    For this example, let’s look at sending output to a networked TCP/IP printer by using a remote writer that is started through an

    …

    Read more
  • Did OPNQRYF Retrieve Records?

    July 24, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Here is a tip you may want to print. Sometimes I need to find out if an Open Query File (OPNQRYF) selection contains any records. For instance, I may want certain programs to run only if OPNQRYF did not select any records. I run the following commands after OPNQRYF runs:

    /*  Copy 1 record for testing purposes  */                            
    CPYFRMQRYF FROMOPNID( IVRPTHDQ ) +
       TOFILE( QTEMP/@DUMMY )  
       MBROPT( *REPLACE ) +
       CRTFILE( *YES ) +
       NBRRCDS( 1 )
    
    RTVMBRD    FILE( QTEMP/@DUMMY ) +
       NBRCURRCD( &RCNT )       
                                                                          
    IF       ( &RCNT *GT 0 ) THEN( DO )                      
       POSDBF     IVRPTHDQ  *Start        
       CALL       
    …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19
  • 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

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