Input-Output Strategies May 15, 2006
I came across an interesting and thought provoking post by Max Harris on his blog From Here to Modernity, where questions about I-O Strategies (when dealing with a critical table) evoked responses from more than 90 iSeries professionals.
Four options were presented as follows:
- Replacing F-specs in RPG program with SQL in all the programs or modules that use the table ( Embedded SQL ).
- Move I-O to a SRVPGM and have a procedure return the record format.
- Move I-O to a SRVPGM and have several procedures which return various data structures.
- Move I-O to a SRVPGM and have field getters and field setters (JAVA).
We all know that first option is not very efficient, but read the post and related comments and arrive at your own conclusion.
Possible Related Links
MMUG Meeting on June 15th, 2006 May 3, 2006
Please mark your calendars for the upcoming MMUG Meeting on June 15th, 2006. The meeting time, venue and topic will be announced later. If you wish to be notified about the meeting and receive latest posts on our website, you can do so without sharing your e-mail address. Yes, you read it right, without sharing your e-mail address. All you have to do is to subscribe to the RSS feed. You must have seen this orange symbols on various web sites and wondered what they mean. RSS stands for Really Simple Syndication or Rich Site Summary. RSS feed lets you read feeds from web sites, blog, news, press releases etc. without actually going to the web sites. RSS feeds come to you and you can read the feeds either through a browser based reader or a RSS reader. You may get this web site’s feed by copying this link: http://i-seriesusergroup.org/feed/ to the RSS reader of your choice.
Possible Related Links
New Events Page April 25, 2006
I have added a new Events page today. Here we will be posting MMUG Meeting and other iSeries related events. Check out the event on May 16th, 2006 at Rosenblatt Stadium. It is a triple deal. You get a presentation on WebFOCUS, lunch and Omaha Royals game to watch. Read about this on Events page and register either on Information Builder’s Web site or send an email to Richard Ely with your name, company name and e-mail address.
Please note: This event is NOT sponsored by Midlands Midrange Users Group. This information is provided as a service to iSeries Users community.
Possible Related Links
Tip: Converting String to Number in QUERY/400 April 18, 2006
Theoretically there is no command to convert a string to number in Query/400, but I found this tip on an iSeries forum. It is little clumsy but can be handy workaround when you do not have access to SQL.
Here is what you do:
The TIMESTAMP function accepts a character representation of a valid time stamp. Because part of the time stamp is a 6 digit microsecond, use the character string to be converted for the microsecond.
* The date and time used is constant and is NOT important for the conversion
* The format of the microsecond is mmmmmm:
6 digits are required and they must be numbers.
If your field is less that 6 digits, it is to be Zero-filled to the left, for example, ‘0000xx’, for a 2-digit field.
If your field is more than 6 digits, do multiple conversions and use numeric operations to calculate the correct value.
If your field requires a decimal portion, do the conversion, then use numeric operations to convert to the correct decimal value.
Once the time stamp is created, the MICROSECOND function can be used to retrieve the numeric representation of the character field.
Following is an example:
fldString is a 4 digit character field in the file. Define the following result fields:
tStamp TIMESTAMP(’1995-01-01-12.00.00.00′||fldString)
fldNumeric MICROSECOND(TIMESTAMP)
If fldString has a value of ‘0045′, then tStamp will look like ‘1995-01-01-12.00.00.000045′ and fldNumeric will result in 45.
If you have a better solution, please post it here by clicking on comments.
Possible Related Links
QSHELL on iSeries April 14, 2006
Ever wondered about QSHELL? It is a UNIX shell on iSeries. To access QSHELL, type in STRQSH on the command line. But before you go any further, head out to Thibault Dambrine’s tutorial : Exploring iSeries QSHELL: Concepts & Tutorial.
This tutorial explains in simple language the syntax of Unix commands, where to find help, how permissions work, and the basics of how to write a QShell script.
Some background on QSHELL: To be fully Java compliant, IBM needed to supply a JDK (Java Development Kit) on its iSeries eServer that could run standard Java commands such as Java, Javac or Javadoc, the same way other (UNIX) systems could. There was only one snag, OS/400 was NOT ’a flavor of’ UNIX. The OS/400 IBM team resolved this hurdle by supplying a new ‘UNIX style shell‘ on the iSeries and appropriately named it ‘QSHELL‘.
Possible Related Links
Open Source iSeries Toolkit April 11, 2006
While searching for an open source software for my other project, I came across Open Source iSeries Toolkit. For those of you new to Open Source Software, it is a program in which the source code is available to the general public for use and/or modification from its original design free of charge. Open source code is typically created as a collaborative effort in which programmers improve upon the code and share the changes within the community. Open source sprouted in the technological community as a response to proprietary software owned by corporations. Learn more about it at opensource.org.
iSeries Toolkit is a bag of utilities that support Dynamic SQL, Messaging, IFS file access, User spaces, User indexes, Dynamic Native File Access, XML, and Source Generation. These RPGIV ILE and Java tools work on most recent releases of the iSeries and AS/400.
Get Involved
Apart from being a user of this toolkit, you can get involved as a developer. You can actually help developing the iSeries Toolkit by either fixing the bugs reported or adding / enhancing the utilities by checking the features requested. This open source project has a very active community that is constantly working on improving the toolkit. You can download the toolkit and try it yourself.
Here are some of the features requested:
- UDF suggestion for dates
- Include a complete list of subprocedures
- DMPSQL data from a table.
- ILE Module Information
- New feature in Seq().
- UserSpace Viewer.
- Add support for the Qp0lGetAttr API
- Update Debug info in CHGOBJ Command
- New SAVZIP Command
Are you ready to accept these challenging tasks?
If you have any comments or opinions, please click on "Comment" link below this article.
Possible Related Links
iSeries RPG programming links April 8, 2006
I am sure every RPG programmer is aware of Scott Klement’s Club Tech iSeries Programming Tips Newsletter, but do you know, he has few other goodies in his bag?
For rookie iSeries RPG programmers, he has a tutorial titled How to Learn RPG.
For iSeries programmers, who want to experiment with pointers, try having Fun with RPG pointers.
Learn about Reading and Writing from Integrated File System or if you are internet-inclined try Sockets and TCP Programming.
Possible Related Links
iSeries Interview Questions April 1, 2006
*** The intention of these interview questions is to challenge my readers. I never intended to give out the answers. Those who seek answers, please use Google search for your quest. Google is your friend. Good Luck!
iSeries has evolved a lot since 1988, but interview questions have remained practically unchanged. Here are few of them which I came across on a forum. This post is also in the General forum. Feel free to contribute the answers to these questions either here in the comments area or in the forums area.
- How do you know if a record exists without doing a READ and CHAIN?
- What will be your approach in going either for OPNQRYF or Logical files. Which one to go for?
- How do you call procedures in ILE?
- What is the syntax of passing parameters to a procedure by value?
- How do you code file / field renames in ILE RPG?
- In ProgramB there is a SBMJOB, which is a call to program C .There is also a CALL to program D from B. How would you check the program C has been executed in D?
- How do you find whether a record is locked or not?
- What is the difference between RPG/400 and RPG4
- How do you find whether a job is a batch job or interactive?
- What you have to do in the display file when you are using message subfile?
- How to set on/off a group of indicators in a single statement?
- How can you determine the number of characters in a variable?
- Let’s consider a variable X of length 20. Move value ‘ABC’ to it.How to determine how many characters does X have?
- Suppose you have 3 members in a database file. How to read records from all the members without using CL (OVRDBF) i.e. Entire process should be handled exclusively in a RPG program?
- How do you do indexing in a physical file?
- Can an indexed file be accessed in arrival sequence in RPG?
- When will DUMP & DEBUG be ignored?
- what is the necessary command needed before OPNQRYF and why?
- Can you copy the records created by the OPNQRYF to other files and how?
- What are different ways to pass data between programs and which one is the efficient way?
- What are the necessary keywords required to code a message subfile?
- What is the purpose of FRCDTA keyword?
- What is the purpose of PUTOVR keyword?
- What is journalling and commitment control?
- What is the purpose of Panel Groups?
- How can a screen field that has changed since the last output operation be detected?
- What would be the effect on the field where reverse image, underline and high intensity?
- Can more than one subfile record be displayed on one line?
Possible Related Links
SQL Brain teaser March 29, 2006
I could have inserted a Sudoku puzzle here, but since we are an iSeries Users Group, here is a brain teaser for the SQL chumps out there. If you know the answer, feel free to post the code with explanation in the comments area below this post or e-mail it to us. If there are no responses, answer will be posted next week. So here it is:
I have two tables and I want to update Column_X in Table 1 with the value in Column_Y in Table 2. Table1 and Table2 are matched on Key1. You have to make sure no null values are written to the Column_X.
Will this piece of SQL code work?
UPDATE Table1 T1
SET Column_X = (SELECT Column_Y FROM Table2 T2 where T1.Key1 = T2.Key1)
What happens when there is no match? How can you prevent it from writing nulls in Column_X?
Hint : You may find your solution in DB2 Cookbook, which is a free download from Graeme Birchall’s website.
Possible Related Links
How to register for iSeries forums March 27, 2006
Here is a step-by-step process to register for the iSeries forums:
- Click on this link to open the registration page in a new window.
- Select an appropriate Username and enter your E-mail address (to receive the password) and click on Register.
- Check your e-mail and go to this link. Enter your Username (from step 2) and password from the e-mail and login.
- Once logged in, click on Profile. Please fill in your Name, nickname, Contact info, a short bio about yourself (if you wish). You can change your password here. After you are done with all changes, click on Update Profile button.
- Next, click on View Site link that is just besides Midlands Midrange Users Group. You will be taken to iSeries Users Group site.
- Now click on Forums and you are ready to view and post in the forum.
- For subsequent visits to the website, just click on the Login link in the sidebar on your right.
Please make sure you read the rules of the forum before posting. Click here to read the rules. If you have further questions about registration process or about the rules of the forum, please send an e-mail by clicking here or via contact form.
Possible Related Links
« newer posts | older posts »
