Help using Base SAS procedures

what does combinations do?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 161
Accepted Solution

what does combinations do?

Hello

I have a code that do not understand and was wondering if someone can help me with. I am attaching the data before and after as an EXCEL file.

Thank you

R.

Code:

data new;

    set old;

    do combinations=1 to  32;

        output;

    end;

run;


Accepted Solutions
Solution
‎04-24-2012 01:07 PM
Super Contributor
Posts: 1,636

Re: what does combinations do?

Hi ,

"do combinations=1 to  32;" added a variable "combinarions" to dataset old and increased the obsevations to 32*(number of obs. in dataset old).

example:

data old;

  input
a b;

  cards;

  1 2

  2 1

  ;

  data
new;

      set
old;

      do combinations=1 to  32;

          output;

      end;

  run;

  proc sort data=new;

  by combinations;

  run;

View solution in original post


All Replies
Solution
‎04-24-2012 01:07 PM
Super Contributor
Posts: 1,636

Re: what does combinations do?

Hi ,

"do combinations=1 to  32;" added a variable "combinarions" to dataset old and increased the obsevations to 32*(number of obs. in dataset old).

example:

data old;

  input
a b;

  cards;

  1 2

  2 1

  ;

  data
new;

      set
old;

      do combinations=1 to  32;

          output;

      end;

  run;

  proc sort data=new;

  by combinations;

  run;

🔒 This topic is solved and locked.

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

Discussion stats
  • 1 reply
  • 178 views
  • 1 like
  • 2 in conversation