• 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
    DRV Technologies, Inc.

    Get More from Your IBM i

    Many users today struggle to get at the data they need on the IBM i. When users get reports, they look like they were formatted some time last century.

    Some organizations are still printing pre-printed forms and checks on impact printers.

    How often do operators log on to their system to look for messages they hope they don’t find?

    All of these scenarios can affect users’ perception of the IBM platform negatively, but there are simple solutions.

    DRV Technologies Inc. develops innovative solutions that help customers get more from their IBM i systems.

    Solutions include:

    • SpoolFlex spool conversion & distribution
    • FormFlex electronic forms
    • SecureChex MICR laser check printing
    • MessageFlex system monitoring

    FlexTools streamline resources, improve efficiency and enable pro-active system management.

    Better software, better service, DRV Tech.

    Learn how you can get more from your IBM i at www.drvtech.com

    Call 866 378-3366 for a Free Demonstration

    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

    • Fortra Issues 20th State of IBM i Security Report
    • FNTS Launches Managed Services for Power Servers in IBM Cloud
    • Total LTO Shipped Capacity Up Slightly in 2022
    • Four Hundred Monitor, May 24
    • Update On Critical Security Vulnerability In PowerVM
    • Critical Security Vulnerability In PowerVM Hypervisor
    • IBM Power: Hosted On-Premises Or In The Cloud?
    • Guru: Watch Out For This Pitfall When Working With Integer Columns
    • As I See It: Bob-the-Bot
    • IBM i PTF Guide, Volume 25, Number 21

    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 © 2023 IT Jungle