# DS-SAS | Nov 10 - Dec 09 | Prateek Sharma

Discussion in 'Big Data and Analytics' started by Nishant_Singh, Nov 10, 2018.

1. ### Nishant_Singh Well-Known Member Simplilearn Support

Joined:
Aug 1, 2018
Messages:
282
99
Hi Learners,

This thread is for you to discuss the queries and concepts related to Data Science with SAS.

Happy Learning !!

Regards,
Team Simplilearn

#1
_33315 likes this.

Joined:
Aug 24, 2018
Messages:
1
0

#2
3. ### _45900 New Member

Joined:
Oct 30, 2018
Messages:
1
0
can we use BY statement twice or many times in do loop?

#3
4. ### Prateek_64 Member AlumniTrainer

Joined:
Jun 1, 2018
Messages:
5
1
Hi,

Yes we can use by statement twice or many times in a do loop.
If there are two do loops, then we can use 2 by statements.
Eg. using 1 by statement.

/*eg. of 1 do loop*/
data one;
do i=1 to 5 by 1;/* creates a variable i which gets incremented by 1*/
a=2*i; /*for each value of i, we need to create a variable which equals 2*i*/
output ;/*writes the value of a and i to the output data set, if we dont write output statement, then only the last
value of a and i will be written to the dataset*/
end; /*ends the do loop*/
run;

/* Eg of nested loops */
data do_loop_eg;
do i=1 to 10 by 2;/* creates a variable i which gets incremented by 2*/
a=2*i;/*for each value of i, we need to create a variable which equals 2*i*/
do j=20 to 30 by 3;/* creates a variable j which gets incremented by 3*/
b=3*j;/*for each value of j, we need to create a variable which equals 3*j*/
output;
end;
end;
run;

As you can see, we have included two by statements inside a do loop.
We need to include the end statement as many times we have included a do loop.

#4
5. ### Prateek_64 Member AlumniTrainer

Joined:
Jun 1, 2018
Messages:
5
1
Hi Guys,

Please attempt it at let me know in case of any problem.

happy learning!!

#5
6. ### _33035 New Member

Joined:
Jun 24, 2018
Messages:
1
0
Hello Prateek,

This is Tatyana.
I am not sure if I am the only one experiencing this, but assignment solution file is blanc.

#6
7. ### Prateek_64 Member AlumniTrainer

Joined:
Jun 1, 2018
Messages:
5
1

Hi Tatyana,

I have uploaded the solutions in the drive

#7
8. ### _26245 Member

Joined:
Mar 16, 2018
Messages:
4
0
Hi Parteek,
I am enrolled in Data science with SAS . I need a help. Can you please share google drive access. Thank you.

#8
9. ### _44102 New Member

Joined:
Oct 16, 2018
Messages:
1
0
Hello
Please provide solution for assignment 2 and 3.

#9
10. ### _40811 New Member

Joined:
Sep 19, 2018
Messages:
1
0
HI Prateek,
As I mentioned yesterday in the class that I am getting blue underlined values in my output. Attaching a screen shot. If you can help why would that be for?

File size:
11.9 KB
Views:
5
#10