BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
InfoAlisaA
Calcite | Level 5

Hello Everyone,

I am working on this problem where I need to have an * by the highest value in a report.

This is my original code:

proc sql flow=6 35;

title 'Orion Library Table Information';

   select memname, nobs label='Rows', nvar label='Columns', filesize label='File Size', maxvar label='Widest Column'

          from dictionary.Tables

   where libname="ORION" and

         memtype ne 'VIEW';

I tried to create a case for the maxvar that was:

         case

               when max(maxvar)

                 then catx('',maxvar,'*')

               else maxvar format

          end as Widest_Column

However, I got the following error when I tried to do that:

Result of WHEN clause 2 is not the same data type as the preceding results.

I am not sure how to do this, but if anyone can help me with this, it will be greatly appreciated.

Thanks!

Alisa

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

maybe could like:

case

               when  maxvar=max(maxvar)

                 then catx('',maxvar,'*')

               else put(maxvar,best8.)

          end as Widest_Column

Ksharp

View solution in original post

2 REPLIES 2
Ksharp
Super User

maybe could like:

case

               when  maxvar=max(maxvar)

                 then catx('',maxvar,'*')

               else put(maxvar,best8.)

          end as Widest_Column

Ksharp

InfoAlisaA
Calcite | Level 5

Awesome! Thank you so much! That worked out! :smileygrin:

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 672 views
  • 0 likes
  • 2 in conversation