I have been trying to change the permissions of all the output datasets created by a SAS code. I know that I can use the chmod command post a dataset's creation to change the permissions. But, what if I have multiple outputs from a code and i want to change their permissions, then how can I dynamically apply chmod on every dataset created in the code without having to manually supply dataset names? Ex. If my SAS code does this :
`Data Lib1.test1
Lib2.test2
Lib3.test3;
Set Work.Test;
If (certain conditions) then output Lib1.test1;
If (certain conditions) then output Lib2.test2;
If (certain conditions) then output Lib3.test3;
run;`
How can I apply chmod to all these datasets after they have been created without having to manually supply the dataset names. I know &syslast can give me the last touched dataset, but what about the other two?
P.S. I can't update the Data step code block here, I can only add code post the end of the Data step mentioned above.
I tried using the Umask command in the very beginning of the session, but it does not let me set the execute permissions.
X umask 000
It only sets rw,rw,rw settings for datasets does not give u=rwx,g=rwx,o=rwx permissions.