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

Is it possible to create  a macro variable this way

%LET  i= 40 LT  Score LE 60;

So that if I have a data set  have

Data have;

INPUT SN Score;

DATALINES;

1     25

2     30

3     80

4     76

5     35

6     50

7     40

8     35

  And Want,

DATA Want;

SET Have;

Where &I;

RUN;

I made some silly attempts, does not seem to work.

Any help would be highly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
RichardinOz
Quartz | Level 8

This error is usually generated when you forget the semicolon on the end of a macro statement.

Close your session and start afresh. 

BTW a closer look at your code would lead me to retract my previous "guess". 

It should work in a new session.

Richard

View solution in original post

4 REPLIES 4
RichardinOz
Quartz | Level 8

Show us the error messages you are getting.

At a guess, it might work with %LET SN = etc etc ;

Richard

rnmishra
Calcite | Level 5

This is the error

 

ERROR: Open code statement recursion detected.

RichardinOz
Quartz | Level 8

This error is usually generated when you forget the semicolon on the end of a macro statement.

Close your session and start afresh. 

BTW a closer look at your code would lead me to retract my previous "guess". 

It should work in a new session.

Richard

rnmishra
Calcite | Level 5

Thanks Richard!

Silly me!!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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