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

Unlike 9.4 the "DATA Step Functions for Reading and Writing Metadata" are not working with Viya. I have tried with a lot of SAS function regarding metadata fetching or update and all of them fail. I believe it is all aroung setting metadata profile, which I am unable to do. Below is example of code I am running.

 

 
1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72        
73         options metaserver="XXXXXXXXXXXX.XX.XX.com"
74                 metaport=8561
75                 metauser="XXXXXXXX"
76                 metapass=XXXXXXXXXXXXX
77                 metarepository="Foundation";
78        
79         /* Get macro variable bit flags. */
80         %mdseccon();
81        
82         data _null_;
83            format tc $20.;
84            length uri $256;
85            tc = "";
86            uri="";
87        
88            /* Create a PhysicalTable object. */
89            rc=metadata_newobj("PhysicalTable",
90                               uri,
91                               "My Demo Table for METASEC");
92        
93            /* Start transaction on object created above using the URI. */
94            rc=METASEC_BEGTRAN(uri,0,tc);
95            if (rc < 0 ) then do;
96               sysmsg = sysmsg();
97               put sysmsg;
98               end;
99        
100           /* ... other operations using the TC ... */
101       
102           /* End the transaction and commit any changes made to */
103           /* the transaction since it was started.              */
104           rc=METASEC_ENDTRAN(uri,tc, &_SECAD_COMMIT_TC );
105           if (rc < 0 ) then do;
106              sysmsg = sysmsg();
107              put sysmsg;
108              end;
109       
110           /* Delete the PhysicalTable */
111           rc=metadata_delobj(uri);
112       
113        run;
 
ERROR: A Transaction Context handle was not specified for the METASEC_ENDTRAN function.
NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
      
 
114       
115        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
128       
1 ACCEPTED SOLUTION

Accepted Solutions
Kalind_Patel
Lapis Lazuli | Level 10

SAS Viya doesn't have Metadata Server, so you can not run any codes related to metadata.

 

Sas Viya uses SAS CAS Server (Cloud Analytic Service) instead of SAS Metadata Server.

View solution in original post

1 REPLY 1
Kalind_Patel
Lapis Lazuli | Level 10

SAS Viya doesn't have Metadata Server, so you can not run any codes related to metadata.

 

Sas Viya uses SAS CAS Server (Cloud Analytic Service) instead of SAS Metadata Server.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 395 views
  • 0 likes
  • 2 in conversation