Architecting, installing and maintaining your SAS environment

How do I read metadata attributes containing more than 32767 chars?

Reply
Occasional Contributor
Posts: 19

How do I read metadata attributes containing more than 32767 chars?

Hi All

 

I need to read the 'DefaultValue'-attribute from the DiagramXml-property. (XML that control the formatting of the job in DI Studio)

 

Unfortunately the content of the attribute is more than 32767 chraracters long so i'm not able to read the full content.

 

spnrc = metadata_getattr(spuri,'DefaultValue',Jobxml);

 

Is there a way to read more than 32767 chars into a sas variable, use char functions on it and write it back?

 

Super User
Posts: 9,932

Re: How do I read metadata attributes containing more than 32767 chars?

Posted in reply to ChristianHandberg

SAS character variables are limited to 32767 characters, so no luck there with SAS code.

Consider using the Java Metadata Interface.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 19

Re: How do I read metadata attributes containing more than 32767 chars?

Posted in reply to KurtBremser

I was affraid that this was the answer. Even the Metabrowser in DisplayManager are not able to display the value, so I think SAS has a little issue :-)

 

Thanks for the fast reply and thank you for the reference to the Java Metadata Interface.

PROC Star
Posts: 464

Re: How do I read metadata attributes containing more than 32767 chars?

Posted in reply to ChristianHandberg

You could also consider using proc metadata to get the XML in a file and then process it using other tools/languages.

Occasional Contributor
Posts: 19

Re: How do I read metadata attributes containing more than 32767 chars?

Posted in reply to PaulHomes

Hi Paul

 

I'll definitely try that as a solution.

 

Until now I've been able to just use the Datastep Metadata Functions, but it seems that I have to explore the possibilities in using Proc Metadata.

 

Thank you for the answer!

Ask a Question
Discussion stats
  • 4 replies
  • 243 views
  • 7 likes
  • 3 in conversation