I saw this code posted in reply to an old post. Could someone please explain the sql steps here?
1) The meaning of Difference/COL1 statement?
2) The inner join with i= and j= statements?
proc sql;
select
aCL.*,
Difference/COL1 as diffStdErr label="Difference Std Err"
from
aCL inner join
aDiffT on i = input(RowName,4.) and j = input(_LABEL_, 4.);
quit
FYI here is the post: Solved: How to get standard error of difference of ls-mean... - SAS Support Communities
@Abishekaa wrote:
I saw this code posted in reply to an old post. Could someone please explain the sql steps here?
1) The meaning of Difference/COL1 statement?
2) The inner join with i= and j= statements?
1) That is a division operator. The result of dividing those two variables will become the new variable diffStdErr .
2) Those are equality tests. So (i = input(RowName,4.)) will be true when the result of converting the first 4 bytes of ROWNAME into a number is a value that matches the value of the variable named I.
Difference/COL1 as diffStdErr label="Difference Std Err"
This is only a query and Difference/COL1 is a division expression and it's value will be displayed under the new column aliased as diffStdErr but the label= assigned a label so Difference Std Err will be in the column header of the query result.
on i = input(RowName,4.) and j = input(_LABEL_, 4.)
The aCL and aDiffT are inner joined on the criteria based on values of column i= converted values of RowName and values of column j= converted values of _LABEL_.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.