I had observations that each and every observations will repeat 5 times in simple program. suggest me any one.
data Ex001;
input Name $ Designee $ 20-32 Department $;
datalines;
Madhu Jr_Associate QA
Sathwik Jr_Associate PB
Mohan Manager PB
Raja Manager QA
Kiran Manager BI
Sainath Manager CL
;
run;
Proc print data = Ex001;
run;
Which i want out put
When putting test data in a datastep like that, ensure the data and the datalines statement all appear left aligned, otherwise you may get issues as SAS reads from position one on each row (you will note how you are putting positional reading in there as well, not a good idea). Also, avoid using tab characters in code, these render differently between operating systems/tools. Use spaces to indent, you can setup SAS to use spaces when pressing tabs - in base SAS it is under the options (spaces always render as 1 character regardless of os/tool, where tabs are different).
data ex001;
input name $ designee $ department $;
datalines;
Madhu Jr_Associate QA
Sathwik Jr_Associate PB
Mohan Manager PB
Raja Manager QA
Kiran Manager BI
Sainath Manager CL
;
run;
data want (drop=i);
set ex001;
do i=1 to 5;
output;
end;
run;
When putting test data in a datastep like that, ensure the data and the datalines statement all appear left aligned, otherwise you may get issues as SAS reads from position one on each row (you will note how you are putting positional reading in there as well, not a good idea). Also, avoid using tab characters in code, these render differently between operating systems/tools. Use spaces to indent, you can setup SAS to use spaces when pressing tabs - in base SAS it is under the options (spaces always render as 1 character regardless of os/tool, where tabs are different).
data ex001;
input name $ designee $ department $;
datalines;
Madhu Jr_Associate QA
Sathwik Jr_Associate PB
Mohan Manager PB
Raja Manager QA
Kiran Manager BI
Sainath Manager CL
;
run;
data want (drop=i);
set ex001;
do i=1 to 5;
output;
end;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.