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

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

  1. Nishant_Singh

    Nishant_Singh Well-Known Member
    Simplilearn Support

    Joined:
    Aug 1, 2018
    Messages:
    222
    Likes Received:
    31
    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.
  2. Lori Roberts

    Lori Roberts New Member

    Joined:
    Aug 24, 2018
    Messages:
    1
    Likes Received:
    0
     
    #2
  3. _45900

    _45900 New Member

    Joined:
    Oct 30, 2018
    Messages:
    1
    Likes Received:
    0
    can we use BY statement twice or many times in do loop?
     
    #3
  4. Prateek_64

    Prateek_64 Member
    Alumni Trainer

    Joined:
    Jun 1, 2018
    Messages:
    5
    Likes Received:
    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

    Prateek_64 Member
    Alumni Trainer

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

    I have uploaded the assignments in the Google drive,
    Please attempt it at let me know in case of any problem.

    happy learning!!
     
    #5
  6. _33035

    _33035 New Member

    Joined:
    Jun 24, 2018
    Messages:
    1
    Likes Received:
    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

    Prateek_64 Member
    Alumni Trainer

    Joined:
    Jun 1, 2018
    Messages:
    5
    Likes Received:
    1

    Hi Tatyana,

    I have uploaded the solutions in the drive
     
    #7
  8. _26245

    _26245 Member

    Joined:
    Mar 16, 2018
    Messages:
    4
    Likes Received:
    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

    _44102 New Member

    Joined:
    Oct 16, 2018
    Messages:
    1
    Likes Received:
    0
    Hello
    Please provide solution for assignment 2 and 3.
     
    #9
  10. _40811

    _40811 New Member

    Joined:
    Sep 19, 2018
    Messages:
    1
    Likes Received:
    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?
     

    Attached Files:

    #10

Share This Page