Guest User

Untitled

a guest
Nov 23rd, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.92 KB | None | 0 0
  1. /******************************************************************************************************************/
  2. /* SOURCE : ftp://ftp.sas.com/techsup/download/web/60811GetSoftwareComponentsandServerComponents.sas */
  3. /* Set the metadata options to match your environment. */
  4. /* Save this program to the your home directory (cd ~ or cd !HOME). Name it GetSoftwareandServerComponents.sas */
  5. /* On Unix systems run the code using a command like the following: */
  6. /* <SASHome>/SASFoundation/9.4/sas ~/GetSoftwareandServerComponents.sas -log ~/GetSoftwareandServerComponents.log */
  7. /* Replace <SASHome> with the actual location SAS is installed on your system. */
  8. /* Retrieve and send the *TWO* XML files created named: GetSoftwareComponents.xml and GetServerComponents.xml */
  9. /* By default they are placed in your home directory (~ or !HOME). */
  10. /* 11/6/2015 - fix missing close on <GetMetadataObjects> and added sysdate to xml file name */
  11. /* 11/24/2015 - improved GetMetadataObjects to extract more information, including modeled properties */
  12. /* 3/27/2017 - improved extract for Server components to retrieve information more helpful for debugging BRT */
  13. /* 6/29/2017 - added logic to extract port numbers on server objects */
  14. /******************************************************************************************************************/
  15.  
  16. options metaserver='your.metadata.host'
  17. metaport=8561
  18. metaprotocol='bridge'
  19. metauser='sasadm@saspw'
  20. metapass='password'
  21. metarepository='Foundation'
  22. ;
  23.  
  24. %let mshost=%sysfunc(getoption(METASERVER)) ;
  25.  
  26. %let response=out=response;
  27.  
  28. %macro setf ;
  29. %if %index (&SYSSCP, WIN) %then %do ;
  30. filename response "%USERPROFILE%\GetSoftwareComponents_&mshost._&sysdate9..xml";
  31. filename server "%USERPROFILE%\GetServerComponents_&mshost._&sysdate9..xml";
  32. %end;
  33. %else %do;
  34. filename response "$HOME/GetSoftwareComponents_&mshost._&sysdate9..xml";
  35. filename server "$HOME/GetServerComponents_&mshost._&sysdate9..xml";
  36. %end;
  37. %mend ;
  38. %setf ;
  39.  
  40.  
  41. filename request temp;
  42. data _null_;
  43. file request;
  44. input;
  45. *_infile_ = resolve(_infile_);
  46. put _infile_ ' ';
  47. cards4;
  48. <GetMetadataObjects>
  49. <Reposid>$METAREPOSITORY</Reposid>
  50. <Type>SoftwareComponent</Type>
  51. <ns>SAS</ns>
  52. <!-- Specify OMI_GET_METADATA(256) + OMI_INCLUDE_SUBTYPES (16) + OMI_TEMPLATE (4) + OMI_XMLSELECT (128) OMI_ALL (1)
  53. + OMI_SUCCINCT (2048) flags -->
  54. <Flags>2453</Flags>
  55. <Options>
  56. <XMLSelect
  57. search="@Id contains '.' "/>
  58. <Templates>
  59. <SoftwareComponent Id="" Name="" ClassIdentifier="" Major="" Minor="" MetadataCreated="" MetadataUpdated="">
  60. </SoftwareComponent>
  61. <Textstore Id="" Name="" MetadataCreated="" MetadataUpdated="" StoredText="" />
  62. <PropertySet Id="" MetadataCreated="" MetadataUpdated="" Name="" PropertySetName="" />
  63. <Document Id="" MetadataCreated="" MetadataUpdated="" Name="" URI="" URIType="" />
  64. <Property Id="" DefaultValue="" Desc="" IsLinked="" IsRequired="" IsUpdateable="" IsVisible=""
  65. MetadataCreated="" MetadataUpdated="" Name="" PropertyName="" PropertyRole="" SQLType="" UseValueOnly=""/>
  66. <Tree Id="" Desc="" IsHidden="" MetadataCreated="" MetadataUpdated="" Name="" PublicType="" TreeType="" />
  67. </Templates>
  68. </Options>
  69. </GetMetadataObjects>
  70. ;;;;
  71. run;
  72.  
  73. proc metadata
  74. in=request verbose &response;
  75. run;
  76.  
  77. %let server=out=server;
  78.  
  79.  
  80. filename request temp;
  81. data _null_;
  82. file request;
  83. input;
  84. *_infile_ = resolve(_infile_);
  85. put _infile_ ' ';
  86. cards4;
  87. <GetMetadataObjects>
  88. <Reposid>$METAREPOSITORY</Reposid>
  89. <Type>ServerComponent</Type>
  90. <Objects/>
  91. <ns>SAS</ns>
  92. <!-- Specify OMI_GET_METADATA(256) + OMI_ALL_SIMPLE (8) + OMI_INCLUDE_SUBTYPES (16) + OMI_TEMPLATE (4) +
  93. OMI_ALL (1) + OMI_SUCCINCT (2048) flags -->
  94. <Flags>2453</Flags>
  95. <Options>
  96. <XMLSelect
  97. search="@Id contains '.' "/>
  98. <Templates>
  99. <ServerComponent Id="" Name="" ClassIdentifier="" Major="" Minor="" MetadataCreated="" MetadataUpdated="">
  100. <SourceConnections>
  101. <SASClientConnection>
  102. <Domain>
  103. <AuthenticationDomain />
  104. </Domain>
  105. <Properties>
  106. <Property />
  107.  
  108. </Properties>
  109. </SASClientConnection>
  110. </SourceConnections>
  111. </ServerComponent>
  112. <SASClientConnection Id="" Name="" MetadataCreated="" MetadataUpdated="" Desc="">
  113. <Domain>
  114. <AuthenticationDomain />
  115. </Domain>
  116. <Properties>
  117. <Property />
  118.  
  119. </Properties>
  120. </SASClientConnection>
  121. <AuthenticationDomain Id="" Name="" MetadataCreated="" MetadataUpdated="" Desc="" />
  122. <Property Id="" DefaultValue="" Desc="" IsLinked="" IsRequired="" IsUpdateable="" IsVisible="" MetadataCreated=""
  123. MetadataUpdated="" Name="" PropertyName="" PropertyRole="" SQLType="" UseValueOnly=""/>
  124. <Machine Id="" Name="" MetadataCreated="" MetadataUpdated="" Desc="" />
  125. <ResponsibleParty Id="" Name="" MetadataCreated="" MetadataUpdated="" Desc=""/>
  126. <SoftwareComponent Id="" Name="" MetadataCreated="" MetadataUpdated="" Desc=""/>
  127. <ServiceType Id="" Name="" MetadataCreated="" MetadataUpdated="" Desc=""/>
  128. <TCPIPConnection Id="" Name="" HostName="" MetadataCreated="" MetadataUpdated="" Port="" Desc=""/>
  129. <Textstore Id="" Name="" MetadataCreated="" MetadataUpdated="" StoredText="" />
  130. </Templates>
  131. </Options>
  132. </GetMetadataObjects>
  133. ;;;;
  134. run;
  135.  
  136. proc metadata
  137. in=request verbose &server;
  138. run;
Add Comment
Please, Sign In to add comment