× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Where do you read &IFSOUT?

Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> 
Sent by: midrange-l-bounces@xxxxxxxxxxxx
09/13/2004 12:15 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
Re: Change all Objects in IFS directory ( Ownership, Authority 
(autorizations/permissions) )







Hi Jorge,

> Given a particular directory in the IFS, I want to change the  ownership 
of
> this diectory and any other object that belongs to this directory.
>
> I also want to introduce, (fix and/or amend) any previous
> authorities/permissions defined against these objects

I've got a CL program that I wrote that I use for this sort of thing.
It's a one-time-use program that I keep around, and each time I modify the
code so that it's ready for the new task.

What this program does is call the QSHELL "find" command, asking it to
output a list of all of the IFS objects that exist within a certain
directory.  It works recursively, so any subdirectories, and objects in
them will also be included.

You'll want to modify the loop in this example to use the CHGAUT or CHGOWN
commands to set up the authority the way you want it.

Here's my program:

PGM

      /* warning: &MYLIB must be a valid library, and cannot +
                   be QTEMP. */

      DCL  VAR(&MYLIB)  TYPE(*CHAR) LEN(10) VALUE('SOMELIB')
      DCL  VAR(&EOF)    TYPE(*LGL)          VALUE('0')
      DCL  VAR(&MYLIB)  TYPE(*CHAR) LEN(10) VALUE('SOMELIB')
      DCL  VAR(&MYFILE) TYPE(*CHAR) LEN(10) VALUE('CHGOWNPF')
      DCL  VAR(&IFSDIR) TYPE(*CHAR) LEN(200)
      DCL  VAR(&IFSOUT) TYPE(*CHAR) LEN(55)
      DCL  VAR(&CMD)    TYPE(*CHAR) LEN(300)

      DCLF FILE(CHGOWNPF)


    /* XXX: CHANGE THIS TO THE SUBDIRECTORY TO WORK WITH: */


      CHGVAR VAR(&IFSDIR) VALUE('/jsm/instance/uccnet')


    /* CREATE &MYFILE */

      DLTF  FILE(&MYLIB/&MYFILE)
      MONMSG CPF2105

      CRTPF  FILE(&MYLIB/&MYFILE) RCDLEN(1024)


    /* CREATE AN IFS PATHNAME FOR &MYFILE */

      CHGVAR VAR(&IFSOUT) VALUE('/QSYS.LIB/' +
                                *CAT &MYLIB  *TCAT '.LIB/' +
                                *CAT &MYFILE *TCAT '.FILE/' +
                                *CAT &MYFILE *TCAT '.MBR')


    /* USE QSHELL TO PUT A LIST OF ALL OBJECTS IN &IFSDIR  +
       (AND ANY SUBDIRECTORIES WITHIN) INTO &MYFILE */

      CHGVAR VAR(&CMD) VALUE( +
                 'find ' *CAT &IFSDIR *TCAT ' > ' *CAT &IFSOUT)
      STRQSH CMD(&CMD)


    /* READ EACH FILENAME FROM &MYFILE AND CHANGE OWNERSHIP */

      OVRDBF FILE(CHGOWNPF) TOFILE(&MYLIB/CHGOWNPF)

LOOP: RCVF
      MONMSG MSGID(CPF0864) EXEC(CHGVAR &EOF VALUE('1'))

      IF (&EOF *NE '1') DO

          /* XXX: CHANGE THIS TO THE CORRECT CHGAUT/CHGOWN COMMAND */

          CHGAUT OBJ(&CHGOWNPF) USER(*PUBLIC) DTAAUT(*RWX) +
                  OBJAUT(*ALL)
          GOTO LOOP
      ENDDO

      DLTF FILE(&MYLIB/&MYFILE)

ENDPGM


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing 
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.