CL to change object owner of files in IFS whose directory name changes monthly

5 pts.
Tags:
CIFS
CL programming
IFS
IFS Commands
IFS Directory
We have a vendor software package the creates a new directory each month in the IFS - ie /photos/201001 for January 2010.  Documents are stored in the directory for a given month and are owned by the user who created them.  We would like to write a cl that can be run monthly to change the object owner for the files in the prior months folder.  Having problems using a variable in the path name.



Software/Hardware used:
Iseries

Answer Wiki

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

Discuss This Question: 2  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
  • TomLiotta
    Having problems using a variable in the path name. And the problem is....? I'd probably just run something like:
    chgvar      &FullString ( 'chown -R' *bcat &NewOwner *bcat &Path )
    Qsys/strqsh cmd( &FullString )
    &NewOwner would be *CHAR 10 and hold the new owner profile. &Path would be however long you needed your path to be to hold your directory names. Your example is "/photos/201001", so it clearly needs to be *CHAR 14 at an absolute minimum. You probably should go at least to *CHAR 128. &FullString needs to be enough to hold the Qshell command plus the owner plus the path, so you might as well go with *CHAR 256. Or you might try just:
    Qsys/strqsh cmd( 'chown -R' *bcat &NewOwner *bcat &Path )
    The chown Qshell utility changes ownership. The -R parameter causes the ownership to be changed for &Path and recursively down through all subdirectories and streamfiles within &Path. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Are you still having a problem? Can you show us what it is? Tom
    125,585 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