cl

pts.
Tags:
AS/400 command keys
AS/400 Directory
AS/400 Naming Convention
CL
If i create txt files in as400 directory with naming convention AA20080101 can we purge these files using an AS400 command.

Answer Wiki

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

I think this one will do it.
Delete Document Library Object (DLTDLO)

Discuss This Question: 11  Replies

 
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
  • Gilly400
    Hi, If it's in the IFS you can use RMVLNK. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • hey thanks it works....but i need to create a code which deletes the old txt files based on date...I have created a prog to purge flat file members by reding from outfile of dspfd but wat can be done to purge members from a folder or directory.
    0 pointsBadges:
    report
  • philpl1jb
    This might do it -- display folder DSPFLR FLR(yourdir) TYPE(*DOC) OUTPUT(*OUTFILE) OUTFILE(yourlib/yourlist) Phil
    49,730 pointsBadges:
    report
  • Dspflr is throwing errors saying folder not found....I believe it work only for folders(FLR) and not directories(DIR) in which my text file is.So how do i go about deleting my txt files based on date?
    0 pointsBadges:
    report
  • Gilly400
    Hi, You can probably use WRKLNK - but this will only output to a spooled file, then you'll have to convert the spooled file to a readable format for your programs. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • converting spool file to a readable format...is that a long process?
    0 pointsBadges:
    report
  • Gilly400
    Hi, Converting to a readable format basically means creating a physical file and copying the spooled file data to the physical file using the following commands :- CRTPF CPYSPLF Then you can read your physical file in CL or RPG. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • I created a flat file and copied a spool file output of dsplnk to this flat file.But am not sure how to extract the name of the text file from this file.
    0 pointsBadges:
    report
  • Gilly400
    Hi, You'll need to read the file into a CL or RPG then pick the data out using %SST (CL) or subfields on an input spec (RPG). Read until you get a record with position 26-29 = 'STMF', then use position 2-25 as the file name. If position 26-29 is not STMF ignore the record. Regards, Martin Gilbert,
    23,730 pointsBadges:
    report
  • hey gilly thanks a lot I was able to read the file in a cl and get the name of the txtfile. i have another query.As you suggested i have created a flat file and then copied the spool file content to this file. Now i have created a txt file as you know in a cl.Can the same cl be used to dsplnk to a splfile and then copy from qsysprt to a flat file.Each time the cl runs a new set of records will get added to the flat file(that is details of new txt file).Purging can be done in a seperate program i believe.Can you assist?
    0 pointsBadges:
    report
  • Gilly400
    Hi, That should work OK - you'll need to specify *LAST for the spoolfile number on the CPYSPLF command. Regards, Martin Gilbert.
    23,730 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