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);

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1010 views
  • 0 likes
  • 2 in conversation