BookmarkSubscribeRSS Feed
DanielYar
Fluorite | Level 6

I'm using SAS Viya suite. I have my data about different units in the organisation as integers (category) 1-9. However, I'd like to present these with the unit's name in the report I'm creating. How can i get the actual names in the report instead of the integers/codes (1-9)?

I have access to SAS Studio and Prepare data.

7 REPLIES 7
JBailey
Barite | Level 11

Hi @DanielYar,

This sounds like a job for SAS Formats. Fortunately, there is a video for that.

 

Creating User-Defined Formats with the FORMAT Procedure in SAS® Viya™

 

Hope this helps.

Best wishes,

Jeff

DanielYar
Fluorite | Level 6

Thank you @JBailey for the reply. it is indeed an advanced solution. For myself with (very) limited coding experience it is rather not an option for now. I thought maybe there could be ways of using report builder features to deal with it.

Thanks again, Daniel

JBailey
Barite | Level 11

Hi @DanielYar 

 

Are you using SAS Enterprise Guide?

 

Best wishes,
Jeff

DanielYar
Fluorite | Level 6

Hi Jeff,

No, I don´t use the Enterprise Guide. I am quite new to SAS and start directly with the last version of Viya last autumn. I just had a Web-based training that give me the basic knowledge about the suite. However, not coding or advanced function yet.

However, I found a work around to the problem by creating new items in the data set with new labels. This add some new items to the table but solve the current problem.

Nevertheless. Id like to go ahead learning more about what you were suggesting and the coding.

 

Thanks for the engagement Jeff.

Best, Daniel 

JBailey
Barite | Level 11

Hi @DanielYar 

 

I am happy that you are making progress. If you need anything else, holler!

 

Best wishes,
Jeff 

LinusH
Tourmaline | Level 20
Even though I haven't used it my self, but I'm pretty sure that there are functionality in Data Preparation to either join with a look up table, or provide a couple of values (If their not too many).
Data never sleeps
ChrisLysholm
SAS Employee

The SAS Data Studio product does provide the 'join' transform as well as a 'calculated column' transform. For this scenario though, I am not sure that 'calculated column' transform would suffice as this transform supports calculation of column in form: <column> = <expression>;

 

Data Studio also provides the 'code' transform which could be used for this use case. Logic could be added such as if/else or select statement to create column. 

 

Documentation for SAS Data Studio to create custom code: SAS Data Studio 2.2 - Create Custom Code

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1382 views
  • 2 likes
  • 4 in conversation