PROC-X.com
An online (unofficial) SAS® journal – written by bloggers

Main menu

Skip to content
  • About
  • add your blog
  • Contact us
SAS

SAS Platform Object Framework MakeFolder Metadata Utility

by Paul Homes • May 26, 2011 • Comments Off on SAS Platform Object Framework MakeFolder Metadata Utility

This post was kindly contributed by platformadmin.com - go there to comment and to read the full post.

Back in July last year I posted MKDIRMD Macro: Creating Tree Folders in Metadata about a SAS macro I wrote to create tree folders in a SAS metadata repository using the SAS Open Metadata API. Just recently I discovered an alternative method using a utility already present in a SAS 9.2 installation: MakeFolder.

I stumbled on MakeFolder in passing whilst looking in the SASPlatformObjectFramework directory (which is /usr/local/SAS/SASPlatformObjectFramework/9.2 on my Linux machine). If you haven’t seen it before, that directory contains a number of tools such as the Batch Export and Import tools for batch migration/promotion of metadata and the ValidateServer utility mentioned in SAS Usage Note 42523: ValidateServer utility to check availability of SAS® 9.2 Business Intelligence servers. I noticed the SASPlatformObjectFramework directory contained a few other utilities too, including MakeFolder which sounded very much like it might, well, make a folder! Since there are already operating system commands to make file system folders I guessed it would probably make metadata folders and so be worth a closer look.

I couldn’t find any documentation for MakeFolder. A search on support.sas.com yielded nothing. The other SASPlatformObjectFramework utilities documented –help parameters so I thought I would try that out first. It displayed the following nice usage message:

userid@host:~$ /usr/local/SAS/SASPlatformObjectFramework/9.2/MakeFolder --help
usage: MakeFolder [options...] folderPath
options include:
 -profile <profile>     Metadata server connection profile.  Can be used in
                        place of the -host, -port, -user, and -password options.
 -user <userID>         User login identity. Required if -profile is not set or
                        if the profile does not contain connection credentials.
 -password <password>   User login password. Required if -profile is not set or
                        if the profile does not contain connection credentials.
 -host <hostname>       Metadata server host. Required if -profile is not set.
 -port <port>           Metadata server port. Required if -profile is not set.
 -?,--help              Print help information.
 -domain <domain>       User authentication domain
 -log <log-file>        Log file or directory.
 -makeFullPath          create intermediate folders if necessary

It all looked quite straightforward, so I tried it out in a development environment. Firstly to create a simple top level folder (/testsimple):

userid@host:~$ /usr/local/SAS/SASPlatformObjectFramework/9.2/MakeFolder -host localhost -port 8563 -user adminpaul@saspw -password thesecretpassword /testsimple
INFO  *** Make Folder started on 26/05/2011 ***
INFO  Server localhost:8563, user adminpaul@saspw.
INFO  Folder /testsimple created.
MakeFolder has completed.

That worked fine and looking in the SAS Management Console Folders tab I could see the folder had been created.

There was also a -makeFullPath to create intermediate parent folders too. I first tried it out without -makeFullPath:

userid@host:~$ /usr/local/SAS/SASPlatformObjectFramework/9.2/MakeFolder -host localhost -port 8563 -user adminpaul@saspw -password thesecretpassword /test/multiple/levels
INFO  *** Make Folder started on 26/05/2011 ***
INFO  Server localhost:8563, user adminpaul@saspw.
ERROR Parent folder /test/multiple/ does not exist.
MakeFolder has completed.

As expected, that produced an error message since I didn’t already have the /test/multiple parent folders. I ran it again, this time with the -makeFullPath parameter:

userid@host:~$ /usr/local/SAS/SASPlatformObjectFramework/9.2/MakeFolder -host localhost -port 8563 -user adminpaul@saspw -password thesecretpassword -makeFullPath /test/multiple/levels
INFO  *** Make Folder started on 26/05/2011 ***
INFO  Server localhost:8563, user adminpaul@saspw.
INFO  Folder /test/ created.
INFO  Folder /test/multiple/ created.
INFO  Folder /test/multiple/levels created.
MakeFolder has completed.

The folder and its parents were all created successfully.

MakeFolder indeed looks very useful. However, since I haven’t seen any official SAS documentation for it, I would err on the conservative side and, unless I hear otherwise, assume it’s not currently supported. Perhaps if someone from SAS Institute is reading they might be able to provide a bit more info about its status.

So now I know two ways to script the creation of metadata folders.

This post was kindly contributed by platformadmin.com - go there to comment and to read the full post.

Tags: Metadata API Metadata Migration Metadata Promotion SAS SAS 9.2 SAS Metadata SAS Usage Notes

Post navigation

← SAS Enterprise Guide options: my favorite 5
another look at CRAN Task Views →

Popular Posts

  • SAS – Lowercase (lowcase) / Uppercase (upcase) / Proper Case (propcase)
  • How do I export from SAS to Excel files: Let me count the ways
  • How to Get Row Numbers in SAS Proc SQL (and DO NOT Use the Undocumented MONOTONIC Function)
  • How to convert the datetime character string to SAS datetime value? (ANYDTDTM and MDYAMPM formats)
  • Using SAS Enterprise Guide to run programs in batch
  • Clear the Results viewer in SAS 9.3

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Sponsors







Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com

Contributors

  • AFHood Group Blog » SAS
  • Avocet Solutions
  • BI Notes
  • Blogging about all things SAS
  • BusinessKen
  • Computing from Out in Left Field
  • Data Steps
  • Enterprise Software Doesn’t Have to Suck
  • Gregor Gorjanc (gg)
  • Heuristic Andrew
  • Jared Prins’ Blog – SAS
  • Ken's SAS tricks
  • Michael @ Scorpio
  • Musings From an Outlier: The SAS Users Blog
  • NOTE: Development With SAS
  • Numbermonger » SAS
  • Peer Revue
  • Peter Flom blog (Statistical Analysis Consulting)
  • platformadmin.com
  • ProcRun;
  • SAS – BioStatMatt
  • SAS – Confounded by Confounding
  • SAS – From a Logical Point of View
  • SAS & Statistics
  • SAS | r4stats.com
  • SAS and R
  • SAS Learning Post
  • SAS Live!
  • Sas on Melinda Higgins, Ph.D
  • SAS Programming for Data Mining
  • SAS support site – SAS Users
  • SAS Users
  • SAS-BI Business Layers
  • SASopedia
  • SASTechies
  • Software & Service
  • Statistical Analysis Consulting
  • StudySAS Blog
  • The SAS Dummy

Recent Posts

  • Getting started with Python integration to SAS® Viya® – Part 12 – Count of Unique Values
  • Automatic cloning of SAS metadata user groups and roles
  • What is SAS Viya?
  • Understanding the _TYPE_ variable in output data sets
  • New certification alert: SAS® Certified Specialist: Administration of SAS® Viya®
  • SAS training: 5 free sessions technologists love
  • Creating a Microsoft Excel report using SAS, Python and SQL!
  • Decode your SAS® macro code with the MFILE and MPRINT options
  • ESM and S9CA: Useful Tools for Migration from SAS 9 to SAS Viya
  • CAS-Action! Advanced Frequency Tables – Part 4
  • CAS-Action! Grouping Frequency Tables – Part 3
  • Using SAS to score a test
  • CAS-Action! Saving Frequency Tables – Part 2
  • CAS-Action! Simple Frequency Tables – Part 1
  • CAS-Action! Rename Columns in a CAS Table

Copyright © 2023 PROC-X.com. All Rights Reserved. The Magazine Basic Theme by bavotasan.com.