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:
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. |