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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.