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
@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'
On your screenshot, I do not see -types and you have specified -nameMatchType incorrectly.
Really?
Anyone?
I guess nobody has scripted their Metadata Exports ...
🙂
@Lenvdb ,
But this returns an error about the use of the NameMatchType option...
Show me an error, please.
This is my script that I run to execute the ExportPackage:
and this is the result - it pushes out the "help" for this command
Are you sure that all variables, that you are using in command, were properly set?
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?
@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'
On your screenshot, I do not see -types and you have specified -nameMatchType incorrectly.
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
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
@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
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
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.