BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rojouno
Calcite | Level 5

HI,

I do not understand the parameters inside the operator in. Please see a data step "temp4" below.

if (st11q01 in (.,.M,.N,.I)) then st11q01=9;

 if (st11q02 in (.,.M,.N,.I)) then st11q02=9;

 if (st11q03 in (.,.M,.N,.I)) then st11q03=9;

 

st11q01, st11q02 and st11q03 are the birth variables of the student, mother and father. The valid codes for these variables are:

1: Country of test

2: Other Country

7: N/A

8: Invalid

9: Missing

Does anyone in the forum know how to interpret inside the parenthesis?

I think the first delimiter, the dot, is to ask if it is null. is it so? But, M, N, I ??

 

Book: PISA Data Analysis Manual, SAS, second edition, 2009

chapter 15: Multilevel model

Thanks. More information on:

https://www.oecd-ilibrary.org/docserver/9789264056251-16-en.pdf?expires=1638869672&id=id&accname=gue...

page 9

data temp4;
 set  Belgica2006;
 /*if (cnt="BEL");*/
 if (st01Q01 not in (7,8,9,10,11,12,13,14)) then st01Q01=.;
 gender=.;
 if (st04q01 in (1)) then gender=1;
 if (st04q01 in (2)) then gender=0;
  
 if (st11q01 in (.,.M,.N,.I)) then st11q01=9;
 if (st11q02 in (.,.M,.N,.I)) then st11q02=9;
 if (st11q03 in (.,.M,.N,.I)) then st11q03=9;

 immig=(100*st11q01)+(10*st11q02)+(st11q03);
img=.;
 if (immig in (111,121,112)) then img=0;
 if (immig in (122,222)) then img=1;
 vocation=.;
 if (iscedo in (1)) then vocation=0;
 if (iscedo in (2,3)) then vocation=1;
 nbmis=0;
 array vecmis (5) vocation st04q01 st01Q01 escs img;
 do i=1 to 5;
 if (vecmis(i) in (.,.N,.I,.M)) then nbmis=nbmis+1;
 end;
if (nbmis=0);
 scie1=pv1scie;
 scie2=pv2scie;
 scie3=pv3scie;
 scie4=pv4scie;
 scie5=pv5scie;
 w_fstr0=w_fstuwt;
 keep CNT SCHOOLID stidstd
scie1-scie5  w_fstr0-w_fstr80
vocation gender st01Q01 escs img;
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello,

 

The SAS language has 28 symbols that are used to represent special numerical values :

  • The symbol . represents a generic missing value.

  • Some applications use .I to represent positive infinity and use .M to represent negative infinity.

  • .N ??

[EDIT] :

SAS/IML® 15.2 User's Guide
Calling Functions in the R Language
Special Numeric Values
https://go.documentation.sas.com/doc/en/imlug/15.2/imlug_r_sect019.htm

 

SAS 9.4 / Viya 3.5
SAS Language Reference: Concepts
Creating Special Missing Values
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p1xr9fm7y8kek5n1hpj008tnu1a1.htm

 

Cheers,

Koen

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

The SAS language has 28 symbols that are used to represent special numerical values :

  • The symbol . represents a generic missing value.

  • Some applications use .I to represent positive infinity and use .M to represent negative infinity.

  • .N ??

[EDIT] :

SAS/IML® 15.2 User's Guide
Calling Functions in the R Language
Special Numeric Values
https://go.documentation.sas.com/doc/en/imlug/15.2/imlug_r_sect019.htm

 

SAS 9.4 / Viya 3.5
SAS Language Reference: Concepts
Creating Special Missing Values
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p1xr9fm7y8kek5n1hpj008tnu1a1.htm

 

Cheers,

Koen

rojouno
Calcite | Level 5
Thanks, I understood, Walter

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 766 views
  • 0 likes
  • 2 in conversation