BookmarkSubscribeRSS Feed
Jeff_DOC
Pyrite | Level 9

Good afternoon.

 

My organization has recently begun mandated Sensitivity Labels for all data reporting. The label is set manually at time of MS Office file-save process. The labels are: Pending Classification, Level 1 - Published, etc. Could anyone let me know if this is possible to assign programmatically when my ODS runs and point me in an information direction?

 

I've been looking but can't find any such issue on the Boards. If someone could point me in the right direction, I would really appreciate it.

12 REPLIES 12
ballardw
Super User

For those of us lucky enough not to have this issue, where exactly do you look in the document to find that bit?

And which file format(s)? There is a chance that something may work for RTF (word) or Excel but not other files.

 

ODS Excel for example has an option Category="" that will put some text is some places in the document properties. But whether it appears where you need it depends on details.

Jeff_DOC
Pyrite | Level 9

Here's all that I know. I assume it's something saved with the document but it's nothing I've heard of before.

 

"When viewed by staff within Outlook, Teams, SharePoint, Word, Excel, or PowerPoint, a sensitivity label appears like a tag applied to documents."

 

I guess what I'm looking for is a way to have my ODS or export automatically assign a level to a document.

 

 

ballardw
Super User

Perhaps SAS tech support a clue.

Reeza
Super User

It looks like Office has it's own Sensitivity labels that can be turned on by a company.
https://learn.microsoft.com/en-us/purview/sensitivity-labels



Assuming this is your reference, I'm not aware of a method to apply the label via ODS. ODS Word is still under development so there is an option to add that in via ballot/suggestion. Other consideration is to post-process the files using PowerShell to add the labels, if possible.

Jeff_DOC
Pyrite | Level 9

That is a great link and tells me way more about what I'm looking at. Interestingly enough the bullet below says the level is stored in metadata. Too bad there's apparently there's no way to set that through ODS.

 

  • Clear text. Because a label is stored in clear text in the metadata for files and emails, third-party apps and services can read it and then apply their own protective actions, if required.

Reeza
Super User
Unfortunately you would need to have it enabled to be able to test it out and I don't have it enabled 😞

Jeff_DOC
Pyrite | Level 9

Yeah, that's why I didn't send any example code. It seems so new there's not much experience with it yet. 

 

Thanks for trying.

Reeza
Super User
Can you upload a fake file (docx or xlsx) with a tag so I can see where the metadata is being stored?
Jeff_DOC
Pyrite | Level 9

Sure thing. Thank you very much.

 

I don't normally upload MS Office files because I was told not to do so. In the Excel sheet is also what appears during the file - save process. This document is set to the level showing in the example.

Tom
Super User Tom
Super User

So the issue with the generation of XLSX file?

What was the setting stored in the file you posted?

Why does the file you posted include a picture?  Are you planning on making XLSX files from SAS that include pictures?

Jeff_DOC
Pyrite | Level 9

Not exactly. 

 

This label setting process happens with any file at time of save. I just need to know if ODS (or some other SAS process) can set it automatically/programmatically during code execution. The picture is just to show what the label assignment looks like and what label is currently set on this document.

Tom
Super User Tom
Super User

So make a file using SAS.  Say something like:

ods excel file='metadata_test.xlsx';
proc print data=sashelp.class(obs=3); run;
ods excel close;

Open the file with Excel and save it as metadata_test_tagged.xlsx, setting some sensitivity tag. 

Then compare the two files.

Note that XLSX files are just ZIP files with special XML files in them.  So unzip the two versions and compare the individual XML files until you figure out where the tag was written.

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
  • 12 replies
  • 1557 views
  • 9 likes
  • 4 in conversation