Monday, August 27, 2018

Retrieve IFS folder content

At present if required to obtain a list of files in IFS folder RTVDIRINF command will provide an output as two files in QUSRSYS library. One file contains the folder details and other contains the files. The disadvantage of RTVDIRINF command is the user must have *ALLOBJ special authority to invoke it. Therefore it is not practical to use it in programs.

Therefore to list files in IFS folder, the following method can be adopted.




OVRDBF FILE(STDOUT) TOFILE(QTEMP/DIRLIST) OVRSCOPE(*CALLLVL) LVLCHK(*NO)

CD DIR('/<to required folder>')

QSH CMD('ls *.*')

You need to write a small CLLE code for this.