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

Hello team,

What does format find $15. mean in SAS?

Please advise me.

Regards,

blue blue

Blue Blue
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User
format find $15.;

This is a FORMAT Statement, and it assigns the $15. format to the variable find.

If this variable is not present in any of the input datasets, it will be defined as character with a length of 15.

If the goal is to actually define the variable as mentioned above, a LENGTH statement would be more appropriate.

View solution in original post

6 REPLIES 6
Reeza
Super User
Did you try looking it up in the documentation? What did it say?
GN0001
Barite | Level 11

Hello team,

I searched for it and I couldn't find it.

 

Regards,

blueblue

Blue Blue
Kurt_Bremser
Super User

If a word appears at the beginning of a data step statement without a following equal sign, then it has to be a Data Step Statement.

Bookmark the link, and use it as a starting point for similar inquiries.

GN0001
Barite | Level 11

 

data out.mydata;
merge thisdata(in=a) thatdata(in=b);
by hkey;
format find $15.;
if a and b then Find = 'Both';
if a and not b then Find = 'not_in_thisdata'
if a then output;
run;
Blue Blue
Kurt_Bremser
Super User
format find $15.;

This is a FORMAT Statement, and it assigns the $15. format to the variable find.

If this variable is not present in any of the input datasets, it will be defined as character with a length of 15.

If the goal is to actually define the variable as mentioned above, a LENGTH statement would be more appropriate.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 2483 views
  • 5 likes
  • 3 in conversation