楼主: anyme
1302 2

关于macro,题目我都看不太懂 [推广有奖]

  • 0关注
  • 0粉丝

本科生

18%

还不是VIP/贵宾

-

威望
0
论坛币
982 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
495 点
帖子
64
精华
0
在线时间
54 小时
注册时间
2005-4-6
最后登录
2022-5-27

楼主
anyme 发表于 2011-4-22 05:25:46 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
sas 新手 刚学到macro 编程

这是老师给的一道题:
Write a SAS program that uses four user-defined macro variables and three automatic macro variables to specify the following in a PROC PRINT step:
a. The most recently created data set as the data set to be printed.
b. The first observation to be printed via a FIRSTOBS= option.
c. The last observation to be printed via a OBS= option.
d. A first title line that displays:
          i. The name of the most recently created data set (i.e., the data set being printed).  
          ii. The range of observations printed.
e. A second title line that displays:
           i. The day of week associated with the beginning of the current SAS session.
           ii. The time of day associated with the beginning of the current SAS session.
f. Whether or not to included observation numbers in the PROC PRINT output.
g. Whether or not to include any assigned variable labels from the data set in the PROC PRINT output.


For this exercise, turn in:
• Your SAS program containing the PROC PRINT step with macro variable references.
• The %LET statements that would precede your program in part a in order to print out observations 10 through 20 using any assigned variable labels and with observations numbers.
• The %LET statements that would precede your program in part a in order to print out observations  5 through 10 using variable names as labels and with no observations numbers.

请教一下,什么叫可或者不可显示 obs 和label啊 还有这一个程序根本不可能啊  还是我题目看错了 反正研究了 一下午 还是没搞明白。

谢谢大家帮忙了
二维码

扫码加我 拉你入群

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

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

关键词:Macro acr CRO Mac observations 题目 Macro

沙发
sas_user 发表于 2011-4-22 08:04:10
options nodate nonumber; *to clear default date and page number from title;
%let firstobs=10;
%let obs=20;
proc
print data=&syslast (firstobs=&firstobs obs=&obs) label; *firstobs and obs represent start and end obs#, label dataset option states label is going to be used;
label clsdt='Date'; * assign user defined label to variable clsdt;
title "&syslast From Observation&firstobs to Observation#&obs";
title2 "&sysday &systime";
run
;
title; *clear the title set previously;
%let firstobs=5; *assign new value to firstobs and obs;
%let obs=10;
proc
print data=&syslast (firstobs=&firstobs obs=&obs) noobs; *print obs#5 to 10, noobs tells SAS don't print observation number;
run
;
已有 1 人评分热心指数 收起 理由
crackman + 3 观点有启发

总评分: 热心指数 + 3   查看全部评分

藤椅
anyme 发表于 2011-4-22 10:11:42
太谢谢了      

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-9 14:55