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

Hello,

 

As indicated in the subject I have 2 date variables A (format: 12DEC2012) and B (format: 20110908) in my data file. I use SAS 9.4 and the following codes, but it always shows A and B are uninitialized. I checked some information from the internet but still do not quite understand how to solve it. Is there anyone can help me figure out the problem?

 

Codes I use:

data abcd.survey;

if A<B then delete;

run;

 

Thanks!

1 ACCEPTED SOLUTION
4 REPLIES 4
AskoLötjönen
Quartz | Level 8

You are missing set-clause, therefore all of your variables are uninitialized.

 

 

ballardw
Super User

@Therain, I am going to  assume you are relatively new to using SAS. You want to be careful with the word "format" as it has a very specific meaning related to value display. Neither of the values you showed are formats. If the variables are SAS date valued variables then the formats respectively would be Date9. and YYMMDD8. Please confirm by running Proc Contents on the data set that the varibles are date values with formats shown above or is A character and B simply numeric (possibly format Best8. 8.0 or similar) or character.

 

 

Therain
Calcite | Level 5

Thank you! That works very well. Yes, I am a new user of SAS and thanks for the explanation.

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
  • 4 replies
  • 2930 views
  • 0 likes
  • 4 in conversation