testing quoted code

Reply
SAS Employee
Posts: 224

testing quoted code

dt << clear row states;
dt << select where( !(Smiley TongueartNo == "81817" & :Month == "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );
dt << invert row selection;
result = dt << Get selected rows;
result = N Row (result);
// Code works fine up to this point


//Would like to run additional analysis only on selected rows,
// however, the following code carries our the calculation on the entire col
// instead of just the selected rows
result2 = dt << Select Where (:Name("Margin Col")<=5);
result2 = N Row (result2);

Message was edited by: ForumAdmin@sas

Message was edited by: ForumAdmin@sas

Message was edited by: ForumAdmin@sas

Message was edited by: ForumAdmin@sas

Message was edited by: ForumAdmin@sas

Message was edited by: ForumAdmin@sas

Message was edited by: ForumAdmin@sas Message was edited by: ForumAdmin@sas
SAS Employee
Posts: 224

Re: testing quoted code

Posted in reply to reneeharper
> dt << clear row states;
> dt << select where( !(Smiley TongueartNo == "81817" & :Month ==
> "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) <<
> Hide( 1 );
> dt << invert row selection;
> result = dt << Get selected rows;
> result = N Row (result);
> // Code works fine up to this point
>
>
> //Would like to run additional analysis only on
> selected rows,
> // however, the following code carries our the
> calculation on the entire col
> // instead of just the selected rows
> result2 = dt << Select Where (:Name("Margin
> Col")<=5);
> result2 = N Row (result2);
SAS Employee
Posts: 224

Re: testing quoted code

Posted in reply to reneeharper
[newcode] dt << clear row states;
[newcode] dt << select where( !(Smiley TongueartNo == &quote;81817" & :Month == "1/2010" [newcode] & :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );
[newcode] dt << invert row selection;
[newcode] result = dt << Get selected rows;
[newcode] result = N Row (result);
[newcode] // Code works fine up to this point


//Would like to run additional analysis only on selected rows,
// however, the following code carries our the calculation on the entire col
// instead of just the selected rows
result2 = dt << Select Where (:Name("Margin Col")<=5);
result2 = N Row (result2); Message was edited by: ForumAdmin@sas
SAS Employee
Posts: 224

Re: testing quoted code

Posted in reply to reneeharper
> [newcode] dt << clear row states;
> [newcode] dt << select where( !(Smiley TongueartNo ==
> &quote;81817" & :Month == "1/2010" [newcode] &
> :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );
> [newcode] dt << invert row selection;
> [newcode] result = dt << Get selected rows;
> [newcode] result = N Row (result);
> [newcode] // Code works fine up to this point
>
>
> //Would like to run additional analysis only on
> selected rows,
> // however, the following code carries our the
> calculation on the entire col
> // instead of just the selected rows
> result2 = dt << Select Where (:Name("Margin
> Col")<=5);
> result2 = N Row (result2);
>
> Message was edited by: ForumAdmin@sas
Ask a Question
Discussion stats
  • 3 replies
  • 200 views
  • 0 likes
  • 1 in conversation