DATA Step, Macro, Functions and more

Do Loop

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

Do Loop

 data new23;
input a @@;
cards;
1 2 3 4 5
;
Write a program to get output like below without any warnings in log
1
22
333
4444
55555;


Accepted Solutions
Solution
‎03-30-2018 09:04 AM
Super User
Posts: 10,621

Re: Do Loop

Posted in reply to rvsidhu035
data new23;
input a @@;
x=repeat(strip(put(a,best.)),a-1);
put x=;
cards;
1 2 3 4 5
;
run;

View solution in original post


All Replies
Respected Advisor
Posts: 2,660

Re: Do Loop

Posted in reply to rvsidhu035

Show us what you have tried.

--
Paige Miller
Contributor
Posts: 56

Re: Do Loop

Posted in reply to PaigeMiller

I DON'T GET WHAT YOU ASKED

Respected Advisor
Posts: 2,660

Re: Do Loop

Posted in reply to rvsidhu035

@rvsidhu035 wrote:

I DON'T GET WHAT YOU ASKED


Show us the code that you have written to solve the problem, and if it doesn't work, we can help you with it.

--
Paige Miller
Contributor
Posts: 56

Re: Do Loop

Posted in reply to PaigeMiller
K
Solution
‎03-30-2018 09:04 AM
Super User
Posts: 10,621

Re: Do Loop

Posted in reply to rvsidhu035
data new23;
input a @@;
x=repeat(strip(put(a,best.)),a-1);
put x=;
cards;
1 2 3 4 5
;
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 111 views
  • 1 like
  • 3 in conversation