• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Odds and Ends

    October 11, 2002 Timothy Prickett Morgan

    Dear Readers:

    Here are yet more answers to miscellaneous questions. Maybe someone has asked me a question to a problem or situation that you were wondering about.

    — Ted

    Question:

    I am regular reader of your programming tips. I had a question, searched the Web for an answer, and couldn’t get the solution. May be I am not looking at the right place.

    Lately, we have been converting programs from RPG/400 to RPG IV. When an RPG IV program abends at runtime, we look at dumps to investigate further. When we look at the dump, the “Statement in Error ……… 13271 (example)” does not coincide with the statement # in the compile listing of the program. The program is compiled with Option(*NODEBUGIO) dbgview(*LIST). Do you know why or have any suggestions as to how we can overcome this problem?

    Answer:

    Thanks for reading Midrange Guru.

    To solve your problem, place the following option in your control (H) specs:

    OPTION(*NODEBUGIO : *SRCSTMT)
    

    Question:

    In regards to the article “OPNQRYF Date Arithmetic“, what is the difference in doing the QRYSLT as a separate parameter, like you show in the article, and having it as part of the Open Query File (OPNQRYF) command , like I have it here?

     

     
    /* record selection string in a variable */
    
      DCL        VAR(&QRYSLT) TYPE(*CHAR) LEN(512)
    
      CHGVAR     VAR(&QRYSLT) +
                   VALUE('type *ge 5')
    
    OPNQRYF    FILE((MYFILE)) QRYSLT(&QRYSLT)
    
    /* record selection string in QRYSLT parameter */
    
    OPNQRYF    FILE((MYFILE)) QRYSLT('type *ge 5')                     
    

    Answer:

    There’s no difference. I prefer to use a variable, so that if the OPNQRYF bombs, I can see the QRYSLT string in a dump. It comes in handy when I’m building a complex QRYSLT expression and I omit a space or put in too many parentheses or something like that.

    Question:

    The article on “FTP’ing a Library” was great. I have one question. How is the source and target 400 identified? Pardon my lack of knowledge using FTP.

    Answer:

    Every machine in a TCP/IP network has an IP address consisting of four numbers separated by dots: for example, 111.22.3.44. You can identify the machine, whether AS/400, PC, or whatever, using such an address.

    Also, every machine has a file called hosts, where you can put names for those addresses. On my PC it’s in the C:Windows directory. Each line has an IP address and a name.

    127.0.0.1       localhost
    111.22.33.44    otherhost
    

    So, you can identify the machine using the symbolic name instead of the IP address if you want to.

    That is:

    ftp otherhost
    ftp 111.22.33.44
    

    are equivalent machine names or identities.

    Question:

    How do I redefine eight scalar date fields as an array in RPG IV?

     

    Answer:

    In the following example, Date is the array that redefines the eight scalar fields:

    D DateDS          ds                                        
    D  POdate                         d                         
    D  ORdate                         d                         
    D  ENdate                         d                         
    D  TRdate                         d                         
    D  CPDate                         d                         
    D  CMDate                         d                         
    D  SHdate                         d                         
    D  IVdate                         d                         
    D  Date                           d   dim(8) overlay(DateDS)
    

    Question:

    I read, with much excitement, “Loading a Tilde-Delimited File into the Database .”  The health care industry is required to use tilde-record-delimited files as part of the Health Insurance Portability and Accountability Act (HIPAA).  I am currently knee-deep in a HIPAA project and hoped the Qshell solution would make my life easier. The records and fields are variable length, and each field is delimited by an asterisk (*).

     

    I tried putting your sed command into the CMD parameter of a CL QSH command, but I got a lot of error messages. How would you run the sed command from a CL program?

    Answer:

    Put the sed command into a script and execute the script. First, create a two-line text file in the IFS and put the sed command there. Let’s say you call it myscript.qsh. (I like to put .qsh on the end of my scripts.) Then run the script from CL:

    QSH CMD('MYSCRIPT.QSH')
    

    Sponsored By
    ADVANCED SYSTEMS CONCEPTS

    SEQUEL meets all your iSeries and AS/400 data access needs in a single, integrated solution:

    • Windows, Web or host user interfaces

    • Convert AS/400 data into PC file formats

    • E-mail or FTP query results, reports and spool files
    • Run-time prompted queries and reports for end users

    • IF-THEN-ELSE logic in queries and reports

    • Report, form and label formatting second to none

    • Easily convert date fields, character-to-numeric, numeric-to-character and other data manipulation

    • SORT or JOIN using a calculated field

    • Quick summarization of data with Tabling function

    • Run multiple SEQUEL requests as one with the SEQUEL Scripting function

    • OLAP Business Intelligence at a fraction of the cost of comparable solutions

    Take 6 minutes to view a SEQUEL ViewPoint ScreenCam movie to see how simple Windows-based AS/400 and iSeries data access can be! In just a few short minutes, you can find out ways to make your job easier and improve data access throughout your organization. Download the ViewPoint movie here .

    For more information or a FREE trial of SEQUEL, call 847/605-1311 or visit Advanced Systems Concepts.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 78 -- October 11, 2002

    Sponsored by
    Rocket Software

    Unlock the full potential of your data with Rocket Software. Our scalable solutions deliver AI-driven insights, seamless integration, and advanced compliance tools to transform your business. Discover how you can simplify data management, boost efficiency, and drive informed decisions.

    Learn more today.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Using APIs to Send Impromptu Messages Reader Feedback and Insights: Dynamic Result Field in Query/400

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 78

This Issue Sponsored By

    Table of Contents

    • Reader Feedback and Insights: Dynamic Result Field in Query/400
    • Odds and Ends
    • Client Access Hotspots

    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