• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

    • Tool Aims To Streamline Git Integration For Old School IBM i Devs
    • IBM To Add Full System Replication And FlashCopy To PowerHA
    • Guru: Decoding Base64 ASCII
    • The Price Tweaking Continues For Power Systems
    • IBM i PTF Guide, Volume 27, Numbers 31 And 32
    • You Can Now Get IBM Tech Support For VS Code For i
    • Price Cut On Power S1012 Mini Since Power S1112 Ain’t Coming Until 2026
    • IBM i: Pro and Con
    • As I See It: Disruption
    • IBM i PTF Guide, Volume 27, Number 30

    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