
yesterday
ChrisNZ
Tourmaline | Level 20
Member since
06-23-2011
- 6,992 Posts
- 1,874 Likes Given
- 650 Solutions
- 2,759 Likes Received
-
Latest posts by ChrisNZ
Subject Views Posted 30 yesterday 34 yesterday 106 a week ago 304 a week ago 322 a week ago 131 a week ago 223 a week ago 467 a week ago 172 2 weeks ago 218 2 weeks ago -
Activity Feed for ChrisNZ
- Posted Re: Why style not applied to SAS Job HTML output? on SAS Programming. yesterday
- Posted Re: Graph DPI forcing large dimensions on Graphics Programming. yesterday
- Got a Like for Re: Add SAS Packages Framework to the SAS Base/Viya. yesterday
- Got a Like for Re: How do i transform data into these? 2 different scenarios here. Monday
- Liked Re: ODS RTF Side to Side Graph/Tables for Ksharp. Sunday
- Got a Like for Re: How do i transform data into these? 2 different scenarios here. a week ago
- Posted Re: How do i transform data into these? 2 different scenarios here on SAS Programming. a week ago
- Got a Like for Re: Efficiently Adding a Shifted Date Column to a Large SAS Dataset. a week ago
- Got a Like for Re: Why is the SAS documentation website always so slow to load?. a week ago
- Got a Like for Re: Why is the SAS documentation website always so slow to load?. a week ago
- Posted Re: Why is the SAS documentation website always so slow to load? on SAS Programming. a week ago
- Liked Why is the SAS documentation website always so slow to load? for Stratocaster. a week ago
- Posted Re: Efficiently Adding a Shifted Date Column to a Large SAS Dataset on SAS Programming. a week ago
- Liked Re: Efficiently Adding a Shifted Date Column to a Large SAS Dataset for mkeintz. a week ago
- Posted Re: How to Write in Bucket s3 Using Bulkload (SAS 9.4M8) on SAS Programming. a week ago
- Got a Like for Re: How to Write in Bucket s3 Using Bulkload (SAS 9.4M8). a week ago
- Posted Re: How to Write in Bucket s3 Using Bulkload (SAS 9.4M8) on SAS Programming. a week ago
- Posted Re: error-Error: SDS Failed to provide the decoder for the data set. The given key was not present i on SAS Programming. a week ago
- Got a Like for Re: Passing huge String without Macro variable in SAS. 2 weeks ago
- Posted Re: Passing huge String without Macro variable in SAS on SAS Programming. 2 weeks ago
-
-
My Liked Posts
Subject Likes Posted 1 06-04-2022 02:52 AM 2 a week ago 1 a week ago 2 a week ago 1 a week ago -
My Library Contributions
Subject Likes Author Latest Post 2 1 3 14 3
10-28-2009
09:41 PM
I don't see why it shouldn't work, and it almost does.
Some parameters seem to cause issues though. This works:
dm log "clear";
signon _001 sascmd="!sascmd" ;
data _null_;
call sleep(5,1);
put "==> Wait for signon 1";
run;
rsubmit _001 wait=no macvar=JOB001 signonwait=y persist=n ;
data _null_;
put "==> Rsubmit on _001 ok";
run;
signon _002 sascmd="!sascmd" ;
data _null_;
call sleep(5,1);
put "==> Wait for signon 2";
run;
libname rwork server=_002 slibref=work;
******rsubmit _002 wait=no signonwait=y persist=n ;
rsubmit _002 wait=yes;************* works with this change ;
data _null_;
put "==> Rsubmit on _002 ok";
run;
endrsubmit ;
endrsubmit ;
... View more
10-28-2009
07:15 PM
SIZE is an unsupported annotate function for labels for Activex.
Java should support it though.
Hit F1 and look for "ActiveX support, Annotate functions" if you have 9.2 to see if this has improved (and let us know).
... View more
10-28-2009
06:32 PM
OldTimer is right. Unquoting is sometimes hit and miss.
The only way I could make this work is by using
proc sql noprint;
select distinct trim(&attrib) into :&attrib._1 - :&attrib._4 from test;
quit;
and then
%unquote(&lefty.ratio_&&&attrib._1&lefty.n)=N/195;
I am unsure why you'd want to carry these hideous names in the data step instead of calling the new variables INFO1-4 and RATIO1-4 though.
This would also allow you to write
RATIO[CLASS_N]=N/195;
instead of doing successive tests.
... View more
10-27-2009
10:46 PM
Use Scott's links to understand the following:
[pre]data OUT;
input PAT_ID MONTH1 MONTH2 MONTH3; * can be written input PAT_ID (MONTH1-MONTH3)(:);
if MONTH1 then do;
MONTH1=sum(of MONTH1-MONTH3);
call missing(MONTH2, MONTH3);
end;
else if MONTH2 then do;
MONTH2=sum(of MONTH1-MONTH3);
call missing(MONTH1, MONTH3);
end;
else if MONTH3 then do;
MONTH3=sum(of MONTH1-MONTH3);
call missing(MONTH1, MONTH2);
end;
else call missing(of MONTH1-MONTH3);
cards;
1 0 1 2
2 1 1 2
3 2 0 1
4 0 0 3
5 3 0 0
6 0 0 2
7 0 2 0
8 0 2 2
;
run;
[/pre]
If you had many months, you'd loop thru them using an array, as Scott said, rather than adding tests.
One step at a time though.
... View more
10-27-2009
10:29 PM
Have you read the CEDA pages?
Particularly:http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002143983.htm
Also about data migration:
http://support.sas.com/rnd/migration/planning/files/crossplatform.html
Why CEDA Is Invoked for a SAS®9 File in a SAS®9 Session
Character encoding: CEDA is invoked when you share a file with users in another locale who have an incompatible encoding. For more information, see the topic about national language support or see Processing Data Using Cross-Environment Data Access (CEDA) in SAS Language Reference: Concepts.
Operating environment family: In a SAS®9 session, you can run the CONTENTS procedure on any SAS®9 file to determine the operating environment where it was created. To learn the operating environment of your current SAS®9 session, create a quick data set and run PROC CONTENTS on it. If the data representation of the file matches that of your current operating environment, then the file is native on that operating environment. If you're running under AIX, Solaris, or HP-UX, you'll notice all of those operating environments are listed in the log, because those operating environments comprise an operating environment family.
To know when CEDA is being used, set the SAS system option MSGLEVEL=I. That is:
options msglevel=i;
Here's an example of the message that displays in the log:
INFO: Data file MYFILES.GRADES.DATA is in a format that is native to
another host, or the file encoding does not match the session encoding.
Cross Environment Data Access will be used, which might require
additional CPU resources and might reduce performance.
Beginning with SAS 9.1.3 Service Pack 4, you get this behavior even if you do not specify MSGLEVEL=I.
Run proc contents, and use the OUTREP= option if needed.
... View more
10-27-2009
09:54 PM
The code above does not work. Please check before posting.
I want ALL records for EACH gender whose maximum value for age is in the interval [16,17]:
select *
from sashelp.class
group by sex
having 16 le max(age) le 17
;
... View more
10-27-2009
09:33 PM
How about you use the description and :
1- replace F10.3 by 10.3
2- replace I5 by 5.
to create the input statement.
On the data side (in the file):
1- replace StarSpace with SpaceDot
Would that work?
... View more
10-27-2009
08:05 PM
It'd be good that you post code that anyone can run.
For eg, replace your data with sashelp samples.
... View more
10-27-2009
07:28 PM
You'll need something like this:
[pre]
data OUT;
set SASHELP.CITIDAY(keep=DATE SNYDJCM);
DSID=open('SASHELP.CITIDAY(keep=DATE SNYSECM where=(DATE > "10jan1988"d and (DATE between ' ||
put(DATE-1,5.)||' and '||put(DATE+1,5.)||')))');
RC=fetch(DSID);
if RC=0 then
do while(RC=0);
SNYSECM=getvarn(DSID,varnum(DSID,'SNYSECM')); *replace varnum() by the number to speed up a wee bit;
output;
RC=fetch(DSID);
end;
else output;
RC=close(DSID);
run;
[/pre]
(I left join the table to itself within 1 day here).
Also, you'll need an index on the secondary table of course.
If you have version 9.2, you might want to look at hash tables as this version allows hash tables with non-unique keys.
2 dates + cusid + w/off + interest occupy 4+4+8+8+8=32 bytes. That's 33 million rows per GB of RAM.
Otherwise, the logic above with the secondary table loaded in memory using a sasfile statement is another option.
Message was edited by: Chris@NewZealand
... View more
10-14-2009
08:14 PM
Thanks Curtis.
Rows are read only once (if applicable) and retained (and potentially over-written), not read over and over as SQL does.
It makes perfect sense now.
A cartesian product is probably more useful (as well as more resource-intensive) than this behaviour, but as long as we are aware of what takes place ...
... View more
10-14-2009
07:29 PM
I always thought that when a variable is present in both tables, the latest (by order of appearance in the merge statement) table's value overwrites the other values in a merge statement. Not so it seems:
[pre]
proc sort data=SASHELP.CLASS out=TEST; * Build TEST table ;
by AGE; * WEIGHT is only populated for ;
run; * the last record of each AGE group ;
data TEST;
set TEST;
by AGE;
if not last.AGE then WEIGHT=.;
run;
data RESULT; * Merge one: one-to-many merge fails ;
merge TEST
TEST(keep=AGE WEIGHT where=(WEIGHT ne .));
by AGE;
run; * Second table values written to first group record only;
data RESULT; * Merge two: one-to-many merge succeeds ;
merge TEST(drop=WEIGHT)
TEST(keep=AGE WEIGHT where=(WEIGHT ne .));
by AGE;
run; * Second table values written to all records;
[/pre]
Can anyone explain this?
... View more
10-14-2009
04:54 PM
How about
sas sql:
select unique EMPNO into :EMPNOS separated by ',' from EMPLIST;
db2 passthough sql:
Select emp_name, emp_status from EMPLOYEE
WHERE Employee_NO in (&EMPNOS) ;
Limitation: &EMPNOS is limited to 64k ... but you can always use several lists if db2 supports longer sql statements.
... View more
10-14-2009
04:45 PM
Weird.
Try playing with the number of records:
proc gplot data=test(obs=100);
plot v1*v2;
run;
to see whether:
1- a specific record throws sas off
2- the volume of data plays a role
... View more