{"id":213,"date":"2014-03-18T20:06:43","date_gmt":"2014-03-18T20:06:43","guid":{"rendered":"http:\/\/www.sebcharrot.com\/blog\/?p=213"},"modified":"2014-03-18T20:06:43","modified_gmt":"2014-03-18T20:06:43","slug":"sas-how-to-exportimport-packages","status":"publish","type":"post","link":"http:\/\/www.sebcharrot.com\/blog\/sas-how-to-exportimport-packages\/","title":{"rendered":"SAS &#8211; How to Export\/Import packages"},"content":{"rendered":"<div id=\"attachment_288\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2014\/04\/biimpmove.png\"><img aria-describedby=\"caption-attachment-288\" loading=\"lazy\" class=\"size-full wp-image-288\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2014\/04\/biimpmove.png\" alt=\"\" width=\"500\" height=\"445\" srcset=\"http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2014\/04\/biimpmove.png 500w, http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2014\/04\/biimpmove-300x267.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-288\" class=\"wp-caption-text\">It&#8217;s also possible to import\/export metadata with the Wizard equivalent<\/p><\/div>\n<p>My team and I have been developing a solution which involves a degree of SAS reports and related metadata. I set up a scheduled, automated backup of our information maps, reports, etc for posterity, and out of general paranoia. For this I used SAS&#8217;s command line export and import capabiltiies, which probably weren&#8217;t designed to be used that way, but which turned out to be really useful.<\/p>\n<p lang=\"en-GB\">It took a wee bit of trial and error, so I thought I&#8217;d document it here.<\/p>\n<p lang=\"en-GB\">(<a title=\"Handy reference link\" href=\"http:\/\/support.sas.com\/documentation\/cdl\/en\/bisag\/65422\/HTML\/default\/viewer.htm#n13lro0e98gxu1n1rc3k9vgcz7h0.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Handy reference link<\/a>)<\/p>\n<p lang=\"en-GB\"><em>Note: If you&#8217;re puttying into your SAS server, make sure that your putty session has &#8220;Enable X11&#8221; ticked.<\/em><\/p>\n<h1 lang=\"en-GB\">\u00a0Export<\/h1>\n<p>(Ignore any new lines in the text below &#8211; I&#8217;ve added those for readability)<\/p>\n<blockquote>\n<p lang=\"en-GB\">\/usr\/local\/SASHome\/SASPlatformObjectFramework\/9.3\/ExportPackage -host &#8220;mysasmachine&#8221; -port 8561 -user myuser@saspw -password mypassword -package &#8220;myPackage.spk&#8221; -objects &#8220;\/Shared Data\/mySourceFolder(Folder)&#8221; -includeDep -subprop<\/p>\n<\/blockquote>\n<ul type=\"disc\">\n<li>\u00a0includeDep means that all objects that the export depends on are also exported<\/li>\n<li lang=\"en-GB\">You can also specify &#8220;-types&#8221; with the types of files you wish to export<\/li>\n<li lang=\"en-GB\">Without specifying &#8220;(Folder)&#8221; on mySourceFolder, all files will be exported &#8220;flat&#8221; i.e. without their folder hierarchy<\/li>\n<\/ul>\n<h1 lang=\"en-GB\">\u00a0Import<\/h1>\n<blockquote>\n<p lang=\"en-GB\">\u00a0\/usr\/local\/SASHome\/SASPlatformObjectFramework\/9.3\/ImportPackage -host &#8220;mysasmachine&#8221; -port 8561 -user myuser@saspw -password mypassword -package &#8220;myPackage.spk&#8221; -target &#8220;\/Shared Data\/myTargetFolder(Folder)&#8221;\u00a0 -subprop myPackage.subprop<\/p>\n<\/blockquote>\n<ul>\n<li>\u00a0Without specifying &#8220;(Folder)&#8221; on myTargetFolder it would create a new folder with the name of the old parent folder in the new parent folder (e.g. \/myTargetFolder\/mySourceFolder)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>My team and I have been developing a solution which involves a degree of SAS reports and related metadata. I set up a scheduled, automated backup of our information maps, reports, etc for posterity, and out of general paranoia. For this I used SAS&#8217;s command line export and import capabiltiies, which probably weren&#8217;t designed to&hellip;&nbsp;<a href=\"http:\/\/www.sebcharrot.com\/blog\/sas-how-to-exportimport-packages\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">SAS &#8211; How to Export\/Import packages<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"categories":[23,24,15],"tags":[75,102,152],"_links":{"self":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":0,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}