全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3412 9
2007-03-26

1.concatenating operator:

eg: data1= 'FA';

data2='1';

data3=data1|| data2;

run;

the value of data3 is FA only.why?

2.As we known, ddmmyy8. or ddmmyy10. are common to use.

Can you write yymmdd10. if the raw data is given 1960/01/01?

Thank you guys.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2007-3-26 03:00:00

One more question about IF Statement.

IF Statement restricts the obs into the output data file only.

eg, one obs contains several variables.The whole obs will be removed or not if one of variables does not match IF statement.

Or the obs is still be read while the specific variable is read as missing value?

Hope everyone can understand what I am talking about.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-26 09:41:00

最后一问。

data work.passengers;

if OrigPassengers = . then

OrigPassengers=100;

TransPassengers= 100;

OrigPassengers= .;

NonPaying= 10;


TotalPassengers= sum (OrigPassengers, TransPassengers);

答案是100。正确的读取顺序应该是怎么样的呀? 谢谢。

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-26 14:01:00

Q1: I get data3=FA1. i don't know what had happen to you.

Q2: yes, you can.you can read data into sas by using informat. when you want to print, you can use any data format to display.

Q3: form my understanding, the whole obs will be missing from the output data set.

Q4:

data work.passengers;

if OrigPassengers = . then OrigPassengers=100; % here OrigPassengers=100

TransPassengers= 100; %TransPassengers= 100;

OrigPassengers= .; $OrigPassengers= .;

NonPaying= 10;


TotalPassengers= sum (OrigPassengers, TransPassengers); %so the total is .+100 = 100

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-27 01:32:00

Q1.

The following SAS program is submitted:

data work.staff;

JobCategory= 'FA';

JobLevel= '1';

jobCategory= JobCategory || JobLevel;

run;

Which one of the following is the value of the variable JOBCATEGORY in the

output data set?

A. FA

B. FA1

C. FA 1

D. ' ' (missing character value)

Answer : A

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-27 01:45:00

For IF Statement:

A raw data file is listed below:

----|----10---|----20---|----30

John McCloskey 35 71

June Rosesette 10 43

TinekeJones 9 37

The following SAS program is submitted using the raw data file as input:

data work.homework;

infile 'file-specification';

input name $ age height;

if age LE 10;

run;

How many observations will the WORK.HOMEWORK data set contain?

A. 0

B. 2

C. 3

D. No data set is created as the program fails to execute due to errors

Answer: C

if the whole obs will be removed from the output dat file if the condition doesnt match IF Statement, how answer is 3 obs?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群