Sounds weird?
Yes, I have to ask this question... It may sound weird but this is what has been happening with MY content. I got to know this from one of my good friends and colleague, Sahil. He has been very supportive since I thought that I should claim my space on the internet, way back in January 2008, was it January? Whatever. This website got on internet on 28th of April 2008. There was not much content then. Ten or twenty pages on HTML and PHP, that's it.
Fight for the right
Since writing to a data queue and reading from it are supposed to be complimentary things, I could not wait to complete this article.
In the previous example, we wrote (sent) some values to the data queue. To verify that those values were indeed written to the data queue, we are using another API QRCVDTAQ we discussed in the earlier blog.
Okay, so far we’ve learnt the basics. Now here’s an example which will clarify the things. In this example, we are sending some entry to the data queue using a data structure.
Why Data Structure?
Data structure makes it easier to send multiple types of data at a time to a data queue. In this example we are trying to send an alphanumeric and numeric data type values to the data queue. However, do remember that everything is passed as a character field only.
Required Vs. Optional Parms
Data queue can be divided into three types based on how they allow you to retrieve individual records. They are
What is an AS400 Data Queue:-
An AS400 data queue is just what it says; it is a sort of queue ;-), a physical one. Data waiting to be picked for processing is lined up in this queue. Once a data record is picked up (by reading the data queue), that record is removed automatically from the queue.
Data Queue and Physical File
Okay, Several times, we need to convert capital letters of a word or an alphanumeric characters to small letters. One practical example which I can think of now is when we receive some input in the form of a flat file. While validating input fields from the flat file, say the Name, we should convert them to all small or all capital before comparing with the system value. Here's a quick and easy way to do the conversion.
The Formula:-
We can capitalize all letters of a particular character variable, using the RPG 400 built in function %XLate.
Source Entry utility does not allow to add more than 32764 records at a time. This is the limitation with SEU. However, AS400 does allow more records to be added to the program source.
This usually is done programatically. Famous tool SYNON is notorious to add frequently more than 32764 records.
If we try to view such source by taking browse option, the error "Member MbrName in file Library/QRPGLESRC exceeds 32764 records." is thrown
by the SEU.
Question is how to view the source generated?
To browse such source,
After several months, I am back with a new post. I was not getting too much time to update the website. I hope you have liked this website so far. Thanks for your support.
Contribute Your Tips
Do you remember the last time you were stuck due to a very small obvious mistake? Do you know something which is very tricky and helps you perform better? Help others not to repeat the mistake and work efficiently by sharing your knowledge. Just email me your tip at admin@tutorialindia.com, with 'AS400 Tips' in the subject line.
I am back with the last part of the article. Now that we have written the trigger program we need to associate this with the physical file. This is done using the command ADDPFTRG.
This is a very easy example, however, it clarifies several things.
Whenever the system calls this program , it(System) passes basically two parameters. The first parameter contains all information we need in the program. e.g. the file, library and member names, Relative record number of the inserted record, commitment lock type, trigger event (Insert, Update etc), trigger time(Before/After), the offset of the old and new records and before and after(Trigger event) images of the database record etc.