BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lenvdb
Quartz | Level 8

Hi all

 

I am looking for some examples on running this SAS Metadata Exportpackage script (in Linux) using the -name and -nameMatchType CONTAINS options.

 

I tried doing this:

opt/sas94/software/SASPlatformObjectFramework/ExportPackage -user $usr -password $pwd -host $sashost -port $sasport -name "$appnm" -nameMatchType CONTAINS "prod" -package "/myfolder/MyExport.spk" -disableX11 -log "/Myfolders/Logs/ExportLog.log";

 

But this returns an error about the use of the NameMatchType option...

 

Can someone show me an example of how this option would work in the REAL WORLD? the SAS Manuals only show you the options as a guide with no real examples...

 

Kind regards

 

Len

1 ACCEPTED SOLUTION

Accepted Solutions
alexal
SAS Employee

@Lenvdb ,

 

Here is a working example:

 

/<SASHome>/SASPlatformObjectFramework/9.4/ExportPackage -user <USER> -password <PASSWORD> -host <HOST> -port 8561 -package '/tmp/1.spk' -objects '/' -types 'Report' -nameMatchType CONTAINS -name 'Test'

 

Export.jpg

 

On your screenshot, I do not see -types and you have specified -nameMatchType incorrectly.

View solution in original post

9 REPLIES 9
Lenvdb
Quartz | Level 8

Really?

Anyone?

I guess nobody has scripted their Metadata Exports ...

 🙂

alexal
SAS Employee

@Lenvdb ,

But this returns an error about the use of the NameMatchType option...

 

Show me an error, please.

Lenvdb
Quartz | Level 8

This is my script that I run to execute the ExportPackage:

 

 

ScriptToRun.PNG 

 

and this is the result - it pushes out the "help" for this command

 

The result...the helpThe result...the help

alexal
SAS Employee

@Lenvdb,


Are you sure that all variables, that you are using in command, were properly set?

Lenvdb
Quartz | Level 8

@alexal

The issue is that the -nameMatchType option is incorrect.

I need to see HOW the option is set and how the value is set..

I use the script without this option and it works, but we have no way to filter the required rows that are returned. At the moment I get everything. I am only interested in the rows containing 2 bits:

"MKTG" and "PROD".

All rows contain MKTG , but only some contain "PROD"

I am hoping that the -nameMatchType with a CONTAINS and a value of "PROD" will help. But how do I specify this in my script?

 

alexal
SAS Employee

@Lenvdb ,

 

Here is a working example:

 

/<SASHome>/SASPlatformObjectFramework/9.4/ExportPackage -user <USER> -password <PASSWORD> -host <HOST> -port 8561 -package '/tmp/1.spk' -objects '/' -types 'Report' -nameMatchType CONTAINS -name 'Test'

 

Export.jpg

 

On your screenshot, I do not see -types and you have specified -nameMatchType incorrectly.

Lenvdb
Quartz | Level 8

Thank you @alexal

 

This working example shows me that I cannot use this option as I thought I would. The documentation from SAS did not explain and provided no working examples...

 

Len

Lenvdb
Quartz | Level 8

Hi @alexal 

Just one more question -

We have a large number of Group Names / ACTs with names like:

 

MKTG_TEST_Campaign1_DEV.act

MKTG_TEST_Campaign1_PROD.act

MKTG_TEST_Campaign2_DEV.act

MKTG_TEST_Campaign2_PROD.act

ACT_TEST_Campaign1_DEV.act

ACT_TEST_Campaign1_PROD.act

ACT_TEST_Campaign2_DEV.act

ACT_TEST_Campaign2_PROD.act

 

Actuarials and Marketing are 2 Tenants on our platform, so they each require their own Backup and recovery to DR.

I need to write a script for Marketing to pick all their PROD act's:

If I use the -nameMatchType CONTAINS -name ===how can I specify that I need ACTs with both these - similar to a SQL query where name contains("MKTG",PROD") 

so it should pick only:

MKTG_TEST_Campaign1_PROD.act

MKTG_TEST_Campaign2_PROD.act

 

Is this at all doable in this tool?

 

Best rgds

Len

alexal
SAS Employee

@Lenvdb ,

 

If your objects has keywords defined, you can do something like this:

 

/<SASHome>/SASPlatformObjectFramework/9.4/ExportPackage -user <USER> -password <PASSWORD> -host <HOST> -port <PORT> -package '/tmp/1.spk' -objects '/' -types 'Report' -keywords "Alex" "Sample"
INFO Current Time: January 30, 2019 8:20:29 AM EST
INFO User Name: sas
INFO Source Metadata Server: <HOST> (Port: 8561)
INFO Filtering on objects containing the following keywords: "Alex", "Sample"
INFO Filtering on the following object types: SAS report

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 2290 views
  • 0 likes
  • 2 in conversation