Hi,
Can anyone let me know the CL Command which will retrive the Object name stored in an IFS folder.
The document name will vary everytime i.e the file name format is MLnnnnnn.TXT where nnnnnn -> is a numeric sequence.
The CL should retreive the file name if the document is present in the given folder.
I tried CHKDLO, but it seems it does not work with a wildcard character like ML*.TXT.
Thanks
Software/Hardware used:
ASKED:
March 2, 2009 1:37 PM
UPDATED:
March 3, 2009 9:08 PM
You can use the DSPLNK command to list the contents in a spool file:
DSPLNK OBJ(‘/DirectoryName/*’) OUTPUT(*PRINT)
Then copy the spool file to a database file:
CPYSPLF FILE(QSYSPRT) TOFILE(SPOOL)
Open the file in your CL program and read the contents.