LinusH
Tourmaline | Level 20
Member since
06-23-2011
- 7,164 Posts
- 1,383 Likes Given
- 280 Solutions
- 2,145 Likes Received
This widget could not be displayed.
-
Latest posts by LinusH
Subject Views Posted 19 10 hours ago 25 10 hours ago 116 10 hours ago 24 10 hours ago 44 10 hours ago 60 Monday 194 Friday 191 Thursday 226 a week ago 340 a week ago -
Activity Feed for LinusH
- Got a Like for Re: Summing person-time from wide month variables into long form. 4 hours ago
- Got a Like for Re: Autogenerate Work Library table name. 5 hours ago
- Liked Re: switch rows to column while keeping the values for andreas_lds. 10 hours ago
- Posted Re: ERROR: A name token was expected on SAS Viya. 10 hours ago
- Posted Re: calculate all possible combinations to calculate PD on Mathematical Optimization, Discrete-Event Simulation, and OR. 10 hours ago
- Posted Re: Summing person-time from wide month variables into long form on SAS Programming. 10 hours ago
- Posted Re: JDBC connection issue on Administration and Deployment. 10 hours ago
- Posted Re: SAS Scheduled Job failure issue on Administration and Deployment. 10 hours ago
- Posted Re: Cant see server bottom on SAS Enterprise Guide. Monday
- Posted Re: Cant see server bottom on SAS Enterprise Guide. Friday
- Posted Re: SAS VIYA Job Schedule Issue on SAS Viya. Thursday
- Got a Like for Re: Select one customer. Wednesday
- Posted Re: Autogenerate Work Library table name on SAS Programming. a week ago
- Posted Re: Autogenerate Work Library table name on SAS Programming. a week ago
- Liked Re: Aggregate to individual level data for ballardw. a week ago
- Got a Like for Re: Select one customer. a week ago
- Posted Re: Aggregate to individual level data on SAS Programming. a week ago
- Liked Re: Select one customer for yabwon. 2 weeks ago
- Liked Re: proc format Ronein for yabwon. 2 weeks ago
- Got a Like for Re: proc format Ronein. 2 weeks ago
-
Posts I Liked
Subject Likes Author Latest Post 1 1 2 1 1 -
My Liked Posts
Subject Likes Posted 1 10 hours ago 1 a week ago 1 2 weeks ago 4 2 weeks ago 1 11-27-2024 06:59 AM -
My Library Contributions
Subject Likes Author Latest Post 12 4 8 3 2
2 hours ago
Convert from WIDE to TALL. So assuming MON1 means JAN2010 you could use a data step like this to transpose it while also generating your MONTH variable.
data have;
input study_id $ exp :$9. group $ mon1 mon2 mon3 mon4 mon5 mon6;
datalines;
S001 exposed a 1 1 0 0 0 0
S001 exposed a 0 0 1 1 0 0
S001 exposed a 0 0 0 0 1 0
S002 exposed b 1 0 0 0 0 0
S002 exposed b 0 1 1 0 0 0
S002 unexposed c 0 0 0 1 1 1
S003 unexposed c 1 1 1 1 1 1
S004 unexposed c 1 1 1 0 0 0
S004 unexposed d 0 0 0 1 1 1
;
data tall;
set have;
array mon[6];
start='01JAN2010'd ;
do month_num=1 to dim(mon);
month = intnx('month',start,month_num-1);
present = mon[month_num];
output;
end;
drop mon1-mon6 ;
format start month monyy7.;
run;
Now summaries are easy.
proc summary nway data=tall ;
class month month_num exp group ;
var present ;
output out=want sum=ptime;
run;
Results:
...
... View more
5 hours ago
I want to mimic the functionality that DI gives when you drag and drop an extract components which has an output table with a generated name.
I can see that your code provides this kind of functionality.
By using the below statements you have mentioned, might be the case and I will definitely give it a try.
data; run;
%let ds = &syslast;
... View more
10 hours ago
"NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks."
If you can't find the problem in the code, try to strip down the macro until it works, and than add code part by part until you find the problem.
... View more
10 hours ago
I think here VAR represents the name of the scoring variable, and VALUE the value of said scoring variable for a customer. In this way of presenting it, it's just a key-value pair construct.
... View more
10 hours ago
I haven't done this, but I would start searching in SAS logs, starting with the MetadataServer and the ObjectSpawner.
Make sure that there are no firewall issues.
... View more
10 hours ago
I would first check if you are using a different userid, since the assign seem to be a authorization issue.
Is the libref assigned through a authdomain tied userid in metadata?
... View more
Thursday
@ballardw Thanks for the reply. I get what you are trying to point out. I do have other variables. This is just a snippet of the dataset. However, I created a separate dataset using the above-suggested code and merged it by Patient ID. It seems to work fine. Also, I think considering using numeric values is a great choice. I did use it as a numeric instead of text. I planned to use the variables for the mixed model logistic regression. Thanks.
... View more
Thursday
Yes there is. If you connect with R to SAS R has its own dataset reader interface what draws through the deleted records too and you can undelete them in R. Another possible option what I have not tried for 25 years - so maybe it does not work anymore - is dBase. As far I remember, dBase export from SAS contained the deleted records too, and you could set them back to undeleted in dBase. There still exists dBase somewhere out there but I did not try it with this version.
... View more
Thursday
Hi,
Thank you for your answer.
The starting time was important because of data dependencies.
You are probably right, but I based my logic on the example from the documentation (3rd line in the printscreen below)
Thank you,
smm662002
... View more
Wednesday
Jedi, "when you ran the programs in separate SAS sessions, the WHERE performed better than the subsetting IF. " Maybe you are right. But sometimes I noticed that IF is a little faster than WHERE , I don't know why ,maybe the environment around SAS installed is a key reason.
... View more
2 weeks ago
1 Like
options missing=' ';
data cntl;
retain fmtname 'F_RONEIN' type 'N' sexcl "N";
length s e i 8 label $64;
s=0;
do e = 0, 1e2 to 5e2 by 1e2, 1e3 to 1e4 by 1e3, 15e3,.H;
i + 1;
start = s;
end = e;
select(end);
when(.h) do;
hlo = 'H';
label = catx(' ',cats('(',i,')'),cats(s,'+'));
end;
otherwise do;
hlo = ' ';
label = catx(' ',cats('(',i,')'),catx('-',s,ifn(e=0,.,e)));
end;
end;
output;
s = e;
sexcl = 'Y';
end;
run;
proc print;
run;
proc format cntlin=cntl cntlout=cntlout;
run;
proc print;
run;
... View more
2 weeks ago
Take a random sample of your data and do all of your data preparation and modelling development on that. Once you have got it working OK, then try it on the full data.
... View more
2 weeks ago
2 Likes
For have1, you try to read four values, but only have three values in each CARDS line. The default FLOWOVER option causes the INPUT statement to read the first value of the following line as the fourth value, and discards the rest, so you miss half of the input lines. Use TRUNCOVER in an INFILE statement to prevent this:
data have1;
infile cards truncover;
input CustID date :date9. Ind_Change balance;
format date date9.;
cards;
111 01JAN2025 0
111 02JAN2025 0
111 03JAN2025 0
111 04JAN2025 1
111 05JAN2025 0
111 06JAN2025 0
111 07JAN2025 0
111 08JAN2025 0
111 09JAN2025 1
111 10JAN2025 0
;
Note the use of the colon modifier to prevent the INPUT statement from switching from list input to formatted input.
For have2, once again you must use the colon modifier:
data have2;
infile datalines dlm="," dsd;
input CustID date :date9. Ind_Change balance;
format date date9.;
cards;
111,01JAN2025,0,50
111,02JAN2025,0,80
111,03JAN2025,0,10
111,04JAN2025,1,15
111,05JAN2025,0,30
111,06JAN2025,0,80
111,07JAN2025,0,90
111,08JAN2025,0,140
111,09JAN2025,1,130
111,10JAN2025,0,125
;
Without it, formatted input reads the next 9 characters and disregards any delimiter. For the next (third) variable, the INPUT statement immediately finds a delimiter, which means (because of the DSD option) that a missing value is encountered. The third value is then read into the fourth variable, and the fourth value is discarded.
... View more
2 weeks ago
1. Have your query work in a SQL Server interface (e.g., SQL Server Management Studio).
2. Attach thew full log in you post.
... View more