In one of my programs I have to read a MQ queue that stores XML documents; the XML documents have to be checked and processed. During the development of this program, it came in handy to create a helper program to copy some XML documents in the IFS to the specific queue. To accomplish this, I found the command Configure HTTP search (CFGHTTPSCH). This command can be used to populate an output file (a source file) that contains a record for each entry in the given IFS directory. It is possible to use a filter for the naming -- or even processing -- the subdirectories. The output file I used in my RPG program to read the names from the IFS documents. To read the files in the IFS, some C-API's can be used (stat, open, read and close). The contents of the files can then be placed on the queue. So, whenever you have to process an IFS-directory, the command CFGHTTPSCH can come in vary handy.
DCL VAR(&DIR) TYPE(*CHAR) LEN(256)
CFGHTTPSCH OPTION(*CRTDOCL) DOCLIST
('/qsys.lib/qtemp.lib/tmpfile.file/tmpfile.mbr') STRDIR(&DIR) SUBTREE(*NONE)PATTERN('*')
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Ask your programming questions--or help out your peers by answering them--in our live discussion forums.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.