Architecting, installing and maintaining your SAS environment

Create metadata folder

Reply
Super Contributor
Posts: 305

Create metadata folder

Dear all,

 

I am using the following syntax in order to create Sas Metadata Folder:

x "/sas/SASPlatformObjectFramework/9.3/MakeFolder -host localhost -port 8591 -user &user -password &dbpass -makeFullPath /Rap/test/lev";

 

For the password I have tried to use:

filename pwfile '/path/text.txt';

 

proc sql noprint;
select strip(setting) into Smiley Tongueass
from sashelp.voption
where optname = "METAPASS";
select strip(setting) into :user
from sashelp.voption
where optname = "METAUSER";
quit;


proc pwencode in="%cmpres(&pass)" out=pwfile;
run;

data _null_;
   infile pwfile obs=1 length=l;
   input @;
   input @1 line $varying1024. l;
   call symput('dbpass',substr(line,1,l));
run;

 

However the procedure writes the pass in the text file something like this: {SAS975.....

when trying to pass the macro variable dbpass to x statement the folder is no longer created ...it seems it tries to use the pass {SAS975..... and the pass does not match the user.

 

Is there a way not to use the password written clearly?

 

we are using AIX and we run batch scripts.

 

I have tried to use a profile file but there is none for the specific user.

 

10x

 

Super User
Posts: 5,256

Re: Create metadata folder

Metadata passwords are always encoded/encrypted when stored, that's for a reason, I think you can guess why.

 

Let's turn around the question, why do you need to create Metadata Folders in code from a SAS program?

Do you plan to create loads of folders, and assign different authorization, and do this data driven?

 

Who will run this program, and when?

Data never sleeps
Super Contributor
Posts: 305

Re: Create metadata folder

Hello,

 

We will have reports generated weekly and monthly and we'd like to store them in dedicated folder.

Thus when we run the reports we need to create subfolder, let's say, week1 and month1 and populate those folder.

 

When running the x statement the authorisation is inherited so we don't have to take care of this

(who evere has access to main folder shall access the subfolders also).

 

The alternative we have is to ask our colleagues from production to manually create this subfolders but we'd prefer create

them from scripts.

 

My colleagues from production only run a *.cmd file which register the tables in metadata - we need to create thos subfolders so the

tables are registered to their corresponding path.

 

I hope i have answered your questions.

 

10x

Trusted Advisor
Posts: 1,141

Re: Create metadata folder

If that is the case, maybe you would like to integrate the process of create metadata folders in the SAS code.

 

Paul Homes describes it well with a simple macro as:https://platformadmin.com/blogs/paul/2010/07/mkdirmd/

Super Contributor
Posts: 305

Re: Create metadata folder

Forget to mention I am using SAS 9.3.

 

Super User
Posts: 5,256

Re: Create metadata folder

I don't work that much with reports, what from your description, it sounds like static reports (pdf or similar). If so, is it necessary to store them in the metadata?

Also, if they are created regularly, you might want to consider a dynamic reports instead, using prompts, cube or whatever to get the information for the selected period.

When creating an infrastructure that needs continues adding of objects in the environment, my alarm bell rings...

Data never sleeps
Super Contributor
Posts: 305

Re: Create metadata folder

Actually there are sas tables which our users access using Sas-Add-INN.

They filter the data based on each user criteria and analyis the data.

 

We only keep 3 month of history therefore not so much data is registered within metadata.

 

I know about Paul Homes solution but he also proposes a new one replacing its macro, the

one i also use - http://platformadmin.com/blogs/paul/2011/05/sasplatformobjectframework-makefolder/

 

10x

PROC Star
Posts: 392

Re: Create metadata folder

Since I wrote those 2 blog posts there is now a third method too (for SAS 9.4 users): sas-make-folder as described in the SAS 9.4 Intelligence Platform: System Administration Guide section on Batch Tools for Metadata Management.

 

Apart from my (outdated) macro which would be used inside a SAS process (such as a SAS Workspace Server) that already has an authenticated connection to the SAS metadata server, the other batch options require the provision of credentials/tokens to the SAS metadata server so they can authenticate that the originator as a valid user and then verify they have permissions to perform the action.  The credentials can be provided using the -user and -password options (the password can be pwencoded) or a -profile option where the credentials are provided in a connection profile (such as one created with SAS Management Console). If you don't want to use a (pwencoded) password either on the command line or in a profile, and your environment is configured to support Integrated Windows Authentication (IWA), then you might attempt that as an alternative (I haven't tried it myself yet so cannot confirm whether works for the batch tools).

Ask a Question
Discussion stats
  • 7 replies
  • 729 views
  • 5 likes
  • 4 in conversation