BookmarkSubscribeRSS Feed
James1214
Fluorite | Level 6

How could I format the variables under ID in Class 4 to have the number variables be labeled with 'ID' like the ones in Class 1, Class 2, and Class 3 using SAS?

3 REPLIES 3
Patrick
Opal | Level 21

How does your ID look like if it's >=100?

data sample;
  length idwant $18;
  do id=1 to 5, 99 to 101;
    if id<10 then
      do;
        idwant=cats('ID',put(id,z2.));
      end;
      else
        idwant=cats('ID',put(id,best16.));
    output;
  end;
  stop;
run;
James1214
Fluorite | Level 6
Thank you for your help
ballardw
Super User

If the "class 4" tab is supposed to continue numbering from "class 3" I think you need to add 84 to the ID.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 853 views
  • 0 likes
  • 3 in conversation