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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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