t*****w 发帖数: 254 | 1 I have not understood the following question meaning yet.
what does "inside" or "outside" in %put statement mean?
Item 62 of 63 Mark item for review
Given the following macro program
and invocation:
%macro MAKEPGM(NEWNAME, SETNAME);
data &NEWNAME;
set &SETNAME;
run;
%put ---> inside macro &NEWNAME &SETNAME;
%mend;
%MAKEPGM(WORK.NEW, SASHELP.CLASS)
%put ---> outside macro &NEWNAME &SETNAME;
Which of these choices shows the correc... 阅读全帖 |
|
i***c 发帖数: 301 | 2 以下是从xml插入表的sql:
CREATE TABLE emps (ID int, EmpName varchar(30))
GO
DECLARE @hDoc int
DECLARE @cDoc varchar(8000)
SET @cDOC = 'ASmithBOB
NewName>'
EXEC sp_xml_preparedocument @hDoc OUTPUT, @cDoc
INSERT INTO emps
SELECT *
FROM OPENXML(@hDOC, '/ROOT/NewName', 3)
WITH
(
ID int '@ID',
NewName varchar(30) '.'
)
EXEC sp_xml_removedocument @hdoc
go
SELECT * FROM emps
go
请教如何改xml内容为文件,试了以下sql报错:
CREATE TABLE emps |
|
s*****n 发帖数: 2174 | 3 1. names(data)[1] <- "newname" 就可以, 如果你不喜欢用数字index, 也可以这样
names(data)[names(data)=="var1"] <- "newname" 或者
names(data) <- gsub("var1", "newname", names(data)) 都可以
2. 你说那个有个条件, 就是BY variable必须是相同的. 考虑如果data1, data2,
data3之间做一个merge. data1和data2之间用var1和var2来做index match, 而data1和
data3之间用var3来做index match. 反正就是这种比较复杂的merge, 每个data之间的
BY variable都不确定. 很难定义一个函数来handle多个data, 除非这个函数本身提供
很多很多参数.
3. 除了SAS, 还有别的语言有你说的这种"最近的data"的概念吗?
是最近一个赋值(写)的, 还是最后一个取值(读)的? 比如
data3 <- merge(data1, data2)
print(data2 |
|
s*******1 发帖数: 101 | 4 %macro MAKEPGM(NEWNAME, SETNAME, PRINT);
data &NEWNAME;
set &SETNAME;
run;
%if &PRINT=YES %then %do;
proc print data=&NEWNAME.(obs=10);
run ;
%end;
%mend;
Which option would provide feedback in the log about the parameter values
passed into this macro when invoked?
A.MPRINT
B.MDEBUG
C.MLOGIC
D.MPARAM
答案是选C。但是似乎MLOGIC是来debug和minor the procedure of execution, such
as beginning of execution, and end of execution.
我不知道为什... 阅读全帖 |
|
m****r 发帖数: 202 | 5 proc contents data=old
out=try(keep=varnum name)
noprint;
run;
data new (keep=newname varnum);
set try;
do i=1 to 1500;
if varnum=(i)
then newname=compress(name)||"_30";
end;
run;
proc transpose data=new
out=aa30d(drop=i _name_);
id newname;
run;
The problem here is some original cha variables have been changed to num
ones. This is not exactly I expect. |
|
x****a 发帖数: 1229 | 6 作业,创建rectangle class, 要求 throw exceptions, 我的code如下:
public class rectangle extends Shape{
public Rectangle ()
{
this(Shape.DEFAULT_SIZE, Shape.DEFAULT_SIZE);
}
public Rectangle (double newLength, double newWidth)
{
this(Rectangle.RECTANGLE_NAME, newLength, newWidth);
}
protected Rectangle (String newName, double newLength, double newWidth)
{
super (newName);
try
{
this.setLength (newLength);
... 阅读全帖 |
|
l**b 发帖数: 457 | 7 Exception本身就是implements了Throwable了的,你extends和implements达到的效果
都是一样的。
我试了你的code,没有你说的问题啊?
Shape.java:
public class Shape {
public static final double DEFAULT_SIZE = 1.0;
private String name;
public Shape(String name) {
this.name = name;
}
}
Rectangle.java:
public class Rectangle extends Shape {
public static final String RECTANGLE_NAME = "Rectangle";
private double length;
private double width;
public Rectangle ()
{
this(S... 阅读全帖 |
|
z**********i 发帖数: 12276 | 8 &&var&i = &newname._&&var&i.在sas中可以正常运行,
但&&var&i = &&var&i._&newname.就没法resolve.
应该在哪里,加几个&呢?试了半天,没试出来。
请指教,多谢!! |
|
p****e 发帖数: 3548 | 9 namespace newname{
#include<...>
} |
|
C**********o 发帖数: 658 | 10 Thanks! I will try!
Yes. Select oldName as newname. |
|
c***n 发帖数: 921 | 11 这个我试验了,可是不行. 让我下周再试试.
不过我写的是 sum(case....) as newName |
|
a*****o 发帖数: 136 | 12 what's your oracle version? 9i/10g/11g?
Use RMAN's duplicate database command,
Here is an example,
http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/backup.102/b14191/rcmdupdb005.htm#i1009381
Example 13-3 Duplicating When Datafiles Use Inconsistent Paths
CONNECT TARGET /;
CONNECT CATALOG rman/cat@catdb;
CONNECT AUXILIARY SYS/oracle@dupdb;
# note that a RUN command is necessary because you can only execute SET
NEWNAME
# within a RUN command
RUN
{
# The DUPLICATE command uses an automatic s |
|
f******g 发帖数: 111 | 13 这个问题好像有点奇怪。但是fully understandable.
1/ goto dos console by typing "cmd" in ”Start"->Run; then use "ren oldname
newname"
2/ in explorer window, menu tool->folder option->view tab->check "display full
path..." then you will see full path of files. you can click in and change
extension. |
|
q**j 发帖数: 10612 | 14 同一个事情先用SAS干了,然后用R干了。有些感想,有些问题。跑来跟大家交流一下啊。
1. R里面改个变量名这么这么难?
需要一个reshape pacakge
data.frame = rename(data.frame, c(oldname = "newname"))
不用这个package就更麻烦了。
2. 控制时间,日期怎么这么难?
以前“告别棒球场”说了,最好不要用日期,全部用字符。临到用的时候才换。就算这
样还是问题多多。比如 “1990-12-04”,怎么样轻松的把它变成 “1990-12-01”(月
初),“1990-12-31”(月末)。往前,往后移动几个月?我写了一个function来干这
个。但是非常慢(yes, I know it.)而且不能往以前移动。我在SAS里面经常用intnx函
数在proc sql的时候来specify where condition。这个用R实在是非常,非常不方便。
# t=intnx("1 mon","2007-12-15",2,'e')
# DateVector = c("2006-02-03","2004-05-06")
# Ne |
|
q**j 发帖数: 10612 | 15 1. 问题不是不能。而是不方便。names(data.frame)一次要全部改变。如果有20个变量
怎么办?一般人会觉得太麻烦吧?如果有 names(data.frame$var1) = "newname"。多
好。
2. SAS里面有in=option.可以解决很多问题。in=0,1。刚好2^n个。而且SAS比较谦虚。吧sql也用上了。这个
让用户很方便。R为什么不考虑兼容sql呢?
3. R完全可以:如果attach(data1),data1就是defualt。如果没有attach(),default attach
最近一个用过的。挺简单的一件事。
另外能不能问 tapply的时候能不能同时分析好几个column?
state <- c("tas", "sa", "qld", "nsw", "nsw", "nt", "wa", "wa",
"qld", "vic", "nsw", "vic", "qld", "qld", "sa", "tas",
"sa", "nt", "wa", "vic", "qld", "nsw", "nsw", "wa",
"sa", "act", "ns |
|
b********y 发帖数: 63 | 16 Not sure how SAS is more convenient on those issues, but they should not be a
problem for R at all.
同一个事情先用SAS干了,然后用R干了。有些感想,有些问题。跑来跟大家交流一下啊。
1. R里面改个变量名这么这么难?
需要一个reshape pacakge
data.frame = rename(data.frame, c(oldname = "newname"))
不用这个package就更麻烦了。
you can just change the name: colnames(x)[1] = newName1.
2. 控制时间,日期怎么这么难?
以前“告别棒球场”说了,最好不要用日期,全部用字符。临到用的时候才换。就算这
样还是问题多多。比如 “1990-12-04”,怎么样轻松的把它变成 “1990-12-01”(月
初),“1990-12-31”(月末)。往前,往后移动几个月?我写了一个function来干这
个。但是非常慢(yes, I know it.)而且不能往以前移动。我 |
|
c*******n 发帖数: 300 | 17 我对SAS数据集中的变量进行重命名,用rename oldname=newname;
然后用proc print看结果,发现变量名没有改变。
我试过别的数据集,那些数据集都可以重命名。
不知道哪里出了问题,请求帮助,谢谢。 |
|
p********a 发帖数: 5352 | 18 多加一个dot? &resolve两次啊
&&var&i.._&newname. |
|
t*****2 发帖数: 94 | 19 QUESTION 72
The following SAS program is submitted:
data work.test;
First='Ipswich, England';
City=substr(First,1,7);
City_Country=City ||', '||'England';
run;
L1= length(City_Country);
L2= lengthc(City_Country);
答案是: L1=25, L2=25
但是把程序改成如下:
City_Country=substr(First,1,7)||', '||'England';
L1= length(City_Country);
L2= lengthc(City_Country);
答案是:L1=16, L2=25
我就怀疑有trailing, 所以试了newname=trim(City_Country);但是长度还是25.我就搞
不清楚这个16是什么情况。
我快疯掉了。帮帮忙! |
|
j********t 发帖数: 201 | 20 While editing SAS Base Certificate Course, I found the following program
useful to organize your base SAS knowledge by one single "run".
If you are interested, run the following program, read the log file and try
to understand all the
contents in the log using what you've learnt about SAS. The key is to
understand how
SAS operates at its data step and data step carries SAS's real power.
hints:
1) what does _all_ means? How many variables you have created yourself? and
why there are some more?
2... 阅读全帖 |
|