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.
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.
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.
Perhaps SAS tech support a clue.
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.
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.
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.
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.
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?
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.
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.