Retreive Document Object name from IFS folder in CL

70 pts.
Tags:
CL Commands
IFS
IFS Folder
IFS objects
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TopKat
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following