• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Edit with Parentheses in Query/400, Take Two

    September 6, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I read your response to the question posted in the August 28 issue of Midrange Guru, and since I don’t work much with negative numbers, I changed data to try your solution. I think I found something, but I don’t know why or how it works..

    I changed the Describe Numeric Field Editing display, as follows: I changed the Replace leading zeroes field with a Y and changed the Replace with field with a 3 (Floating currency symbol). Here’s an example:

    Describe Numeric Field Editing                      
                                                                                 
     Field . . . . . . :   JEAMT                                                 
                                                                                 
     Type choices, 
    …

    Read more
  • Reader Feedback and Insights: Odds and Ends Always Popular

    September 4, 2002 Timothy Prickett Morgan

    Dear Readers:

    I thought I’d share a few of the many comments that I’ve received about the Odds and Ends column that I periodically publish in Midrange Guru.

    — Ted

    I love your Odds and Ends column. Please publish it more often–at least once a week. That is how I learn some programming tricks. Even if you don’t get questions from programmers, I am sure that you have enough tricks (by tricks, I mean smart way of doing things) that could help readers of Midrange Guru.

    — Manouchehr

    Your Odds and Ends column is wonderful. I have wondered

    …

    Read more
  • Starting the Host Database Server Daemon After an OS/400 V5R1 Upgrade

    September 4, 2002 Timothy Prickett Morgan

    Hey, Joe:

    We just upgraded our V4R5 AS/400 to OS/400 V5R1, and we have a problem. After the upgrade, the host database server daemon (as-database) won’t start when we issue the Start Host Server (STRHOSTSVR) command with the *ALL option. This is affecting some of our remote access applications, including some WebSphere applications.

    What’s going on here, and how do I get this host server running again?

    — Jake

    I ran into this problem on a recent OS/400 V5R1 upgrade, and it’s an easy fix once you know what’s going on. As you already know, issuing the STRHOSTSVR command in

    …

    Read more
  • Parameterized RUNSQLSTM with Two or More Substitutions

    September 4, 2002 Timothy Prickett Morgan

    Hey, Ted:

    In the June 21 issue of Midrange Guru, you shared a Qshell sed command to create a source member that can be used under the Run SQL Statement (RUNSQLSTM) command.

    Your example replaced one token. However, I need to make multiple changes using one sed command. For example, this is the pattern source member:

     Insert into MyFile                
         ( Select distinct a.LOGNBR       
           from File1 a, File2 b    
           Where a.ORGLOGNBR = 'LLLLLLL'  
             and b.LOGNBR    = 'LLLLLLL'  
             and b.SEQNBR    =  NNNN      
             and a.CNTL = b.CNTL )        
    

    I want to change LLLLLLL and NNNN together with one sed command. Otherwise

    …

    Read more
  • Reader Feedback and Insights: Splitting a Qshell Variable

    August 30, 2002 Timothy Prickett Morgan

    Hey, Ted:

    The tech tip for splitting a Qshell variable is certainly one way to do it, but it seems to me a roundabout approach.

    My first thought would be to use the “split” command in awk, but awk does not seem to be a supported language in Qshell.

    Instead, I would use the “cut” command, which is supplied along with Qshell. Something like this example:

    first=$(echo $name | cut -d " " -f 1)
    last=$(echo $name | cut -d " " -f 2)
    

    We have to pipe the variable into the “cut” command because cut normally works on

    …

    Read more
  • Adding Subprocedures to a Service Program

    August 30, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I’m still new to ILE, procedures, and service programs. I thought you could add procedures to the end of a service program, then recreate the service program and use it without recreating any existing program that has it bound in. Is this true, or am I off track?

    — Tim

    You need to learn and use binder language, Tim.

    Here’s an example that I hope will help you get started.

    Once there was an RPG programmer named Dan D. Koder. Dan decided to create a service program for frequently used math routines.

    Here’s the source code:

    H nomain                                     
    
     
    …

    Read more
  • A Fuzzy Search Algorithm

    August 30, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Most inquiry programs require a user to enter the exact value or exact beginning portion of a value to be located. Unfortunately such programs do not find the desired data if the user doesn’t remember the exact spelling of the search term. I have an algorithm that allows searching by any portion of a database field, even if the user misspells the search argument.

    According to this algorithm, the position of each character of the input value is to be compared with the position of the same characters found in the corresponding field from the file. It calculates

    …

    Read more
  • Timestamps and V5R1 RPG

    August 28, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I enjoy reading the tech tips in Midrange Guru, especially how to break up a string in Qshell . (You figured that out on a cocktail napkin at a bar, right?)

    Craig Rutledge’s recent tip on comparing timestamps in RPG free is a bit too “robust.” To create a timestamp, just do this:

    legacy_stamp = %date(legacy_date:*MDY) + %time(legacy_time:*hms);
    
    defined_stamp = defined_date + defined_time;
    

    — Chris

    I can’t take credit for the Qshell tip to split up a parameter. As with so many other RPG, CL, OCL, and VB tricks of the trade, I learned that tip from

    …

    Read more
  • A CPYF Idiosyncrasy Revisited

    August 28, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I just noticed the article regarding the CPYF idiosyncrasy in January 23 issue of Midrange Guru, OS/400 Edition . The writer wanted to copy records with a user profile field that was equal to CEM.

    I had the same problem. To solve it, I defined two variables. The first contained the exact value for which I was looking. I used the Change Variable (CHGVAR) command to set the second variable to the value of the first variable with a ‘!’ character added to the end of text. I used the Copy File (CPYF) command with the Include

    …

    Read more
  • Edit with Parentheses in Query/400

    August 28, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Is there a way to make Query/400 place parentheses or angle brackets around negative numbers?

    — Chuck

    Yes, but I’m not crazy about it.

    From the Define the Query panel, select Specify report column formatting. This will show you a list of fields that have been selected for output. Place the cursor on the field that you want to edit and press F16 to specify editing. In the Edit option prompt, choose 1 (Numeric editing choices). Change Show negative sign to Y if necessary. Key an open parenthesis (or left angle bracket) into the Left negative sign field

    …

    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