BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hI,
i have a table like this

number value
1 12
2 23
3 45

While executing the sas programm ask the number and print that record only

i.e you give 1

then output like this

Number Value
1 12
***************
i.e you give 2

then output like this

Number Value
2 23
1 REPLY 1
Anitha_SAS
SAS Employee
Here is an example:

data test;
input number 1 value $3-4;
cards;
1 12
2 23
3 45
;
run;

%macro pr(lineNum);
proc print data=test(firstobs=&lineNum obs=&lineNum);
run;
%mend;
options mprint;
%pr(4);

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
  • 1 reply
  • 840 views
  • 0 likes
  • 2 in conversation