List IFS Directories via QSHELL LS command - Support

List IFS Directories via QSHELL LS command

From Support

Jump to: navigation, search

- Listfile has to be created with the CRTPF command without a DDS, the length of the record depends on the maximum possible length of the filename in the IFS dir.

- QSH needs to be installed.

On execution of this command, which is nothing but an output redirection, the file listfile is populated with the filenames of the files in IFS.

DCL        VAR(&LSCOMMAND) TYPE(*CHAR)
 LEN(200)
 DCL        VAR(&LIBRARY) TYPE(*CHAR) LEN(10) 
 
 CHGVAR     VAR(&LSCOMMAND) VALUE('LS /dir1/dir2/ > +
  
              /QSYS.LIB/' *TCAT &LIBRARY *TCAT +     
       
              '.LIB/listfile.FILE/listfile.MBR')     

Personal tools