70 pts.
 Retreive Document Object name from IFS folder in CL
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

Answer Wiki:
I found my answer. Not a CL command but RPGLE opcodes of OpendDir(), readDir() & CloseDir(). ****** Just for clarity, those are not operation codes, but C functions that can be used in ILE via the QC2LE binding directory. CWC
Last Wiki Answer Submitted:  March 3, 2009  5:44 pm  by  Cwc   4,275 pts.
All Answer Wiki Contributors:  Cwc   4,275 pts. , Vijesh Bhat   70 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 135 pts.