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

Hi,

 

I wanna print some variables where 'EventDate' variable is 01Jan2016 to 31Jan2016. I am writing following syntax;

 

proc print data=GPvisit;
var eventdate pkid status visit month professionalcontact;
where ('01JAN2016'd =<EventDate>= '31JAN2016'd) ;
run;

 

It doesn't seem to work.

 

Can someone help with the code please?

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

@sks521 wrote:

where ('01JAN2016'd =<EventDate>= '31JAN2016'd) ;


Hi @sks521,

 

First, correct the syntax error ("=<") and the logical error (">=") in your WHERE condition and then rerun the step.

where '01JAN2016'd<=EventDate<='31JAN2016'd;

View solution in original post

3 REPLIES 3
tsap
Pyrite | Level 9
Can you provide more details about the table, GPVisit? Like logic to create a dummy table that looks like the GPVisit table. That way we can have a better idea of what we are referencing in the proc print statement you have included in your post.

Check out this link if you need help creating the dummy table: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...
FreelanceReinh
Jade | Level 19

@sks521 wrote:

where ('01JAN2016'd =<EventDate>= '31JAN2016'd) ;


Hi @sks521,

 

First, correct the syntax error ("=<") and the logical error (">=") in your WHERE condition and then rerun the step.

where '01JAN2016'd<=EventDate<='31JAN2016'd;
sks521
Quartz | Level 8

Fabulous! thanks

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 1154 views
  • 1 like
  • 3 in conversation