BookmarkSubscribeRSS Feed
DivyaA
Calcite | Level 5

Hi All, 
I'm Trying to export SAS Dataset to JSON Object but the Variable Labels are missing in the output file. 
Please throw some light on how to fix this?
Regards,
DivyaA

 

1 REPLY 1
Quentin
Super User

How are you exporting the data, proc JSON?

 

This answer replaced variable names with labels during the export:

https://communities.sas.com/t5/SAS-Programming/How-do-I-use-a-Variable-Label-in-JSON-key-PROC-JSON-E...

 

Is that what you want?  Or do you want a separate json object listing the variables and labels?  If the latter, perhaps run PROC CONTENTS and output that to a SAS dataset, then export that dataset to JSON.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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