04-07-2025
kelxxx
Quartz | Level 8
Member since
09-20-2018
- 52 Posts
- 142 Likes Given
- 9 Solutions
- 22 Likes Received
-
Latest posts by kelxxx
Subject Views Posted 1443 04-20-2023 11:37 AM 1607 03-31-2023 11:37 AM 1637 03-31-2023 11:19 AM 1672 03-31-2023 11:06 AM 744 08-16-2022 10:08 AM 787 08-16-2022 09:59 AM 4431 07-21-2022 09:31 AM 991 03-14-2022 05:30 AM 1562 01-24-2022 12:05 PM 1569 01-24-2022 12:04 PM -
Activity Feed for kelxxx
- Liked Re: Conditional ratio of values for ballardw. 08-29-2023 03:07 AM
- Liked Re: Conditional ratio of values for Patrick. 08-29-2023 03:06 AM
- Liked Re: Delete row with condition for SASJedi. 08-08-2023 09:50 AM
- Liked Re: Insert Macro Variable into CARDS listing for Kurt_Bremser. 08-07-2023 04:06 AM
- Liked Re: Detect or Exclude rows which include not standard ASCII characters for FreelanceReinh. 08-02-2023 10:44 AM
- Liked Re: Detect or Exclude rows which include not standard ASCII characters for Ksharp. 08-02-2023 10:44 AM
- Liked Re: Detect or Exclude rows which include not standard ASCII characters for SASJedi. 08-02-2023 10:43 AM
- Liked Re: How to check for an array of columns and search for specific pattern of events for SASKiwi. 08-02-2023 10:42 AM
- Liked Re: How to check for an array of columns and search for specific pattern of events for Tom. 08-02-2023 10:38 AM
- Liked How to create a data step version of your data AKA generate sample data for forums for Reeza. 08-01-2023 09:48 AM
- Liked Re: Need alternative of "Filename" statement with Pipe operator for SAS University Edition for Kurt_Bremser. 08-01-2023 09:44 AM
- Liked Re: Adding rows based on dates for Kurt_Bremser. 08-01-2023 09:34 AM
- Liked Re: Adding rows based on dates for Ksharp. 08-01-2023 09:32 AM
- Liked Re: Do loop run one extra step and duplicate last result for PaigeMiller. 08-01-2023 09:30 AM
- Liked Re: Do loop run one extra step and duplicate last result for sbxkoenk. 08-01-2023 09:30 AM
- Liked Re: Ignore macro function into a string for Quentin. 08-01-2023 09:29 AM
- Liked Re: How to identify family linkages within and across generations? for Ksharp. 08-01-2023 08:55 AM
- Liked Re: Reading multiple external folder names and files for Kurt_Bremser. 08-01-2023 03:17 AM
- Liked Re: Do loop for nonconsecutive number for SASKiwi. 07-09-2023 12:56 AM
- Liked Re: Do loop for nonconsecutive number for Tom. 07-09-2023 12:56 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 2 3 1 3 -
My Liked Posts
Subject Likes Posted 1 08-16-2022 09:59 AM 1 07-21-2022 09:31 AM 1 12-26-2021 04:22 PM 5 12-24-2021 05:36 AM 1 12-24-2021 05:04 AM
04-16-2020
08:27 PM
I finally pulled through. Below is my working macro code. %macro KW_MC (obsvar,classvar,dataname,alpha); proc npar1way data=&dataname; class &classvar; var &obsvar; run; %mend; /*invoke the KW_MC macro*/ %KW_MC(obsvar= x, classvar= y, dataname=a , alpha=0.05);
... View more
04-16-2020
04:33 PM
1 Like
Thank you! This worked perfectly!
... View more
04-16-2020
10:41 AM
Since you are examining only 2 time variables, min(time1,time2) is the same as coalesce(time1,time2) for your purposes (i.e. when there is one or more missing value):
data want;
set have;
newtime=min(time1,time2);
run;
... View more
04-16-2020
10:15 AM
1 Like
sorry to revive the subject
I found how to use SCAN() here
Data RawTbl;
input string $50. ;
cards;
HSBC buisness bank UK
Poland Bank Millenium
Shopping centre Mokotow
CommerzBank abc
;
Run;
data have;
set rawtbl;
string1=prxchange('s/bank/#/i',1,string);
if index(string1,"#") then result=scan(string1,1,"#");
run;
1. change the word "bank" to a specific character that cannot be exited in string
explain of prxchange('s/bank/#/i',1,string)
s= to remplace
/= separate the argument
bank = key word "bank"
# = character to change
i = case insensitive
1 = replace the first occurrence of "bank" (-1 if want to replace all "bank" in string)
string= source of text;
2. use SCAN() with delimiter = the character specified and IF for control then case of "Shopping centre Mokotow"
Have a good day.
... View more
04-16-2020
06:39 AM
options yearcutoff=2000;
%let indate=01/01/18;
%let outmon=12/18;
data toto;
sdate=input("&indate",ddmmyy8.);
emon=input("01/&outmon",ddmmyy8.);
edate=intnx ('month',emon,0,'E');
days=edate-sdate;
do i=0 to days;
datest=sdate+i;
output;
end;
format datest ddmmyy8.;
keep datest;
run;
Hi,
it is not optimal but it works
have a nice day.
... View more
04-16-2020
04:59 AM
1 Like
hi
you can use indexw(), findw()
it would be better to use upcase or lowcase for case-insensitive
if indexw(upcase(NAME),"LIVERPOOL") then output;
if findw(lowcase(NAME),"liverpool") then output;
if findw(NAME,"liverpool"," ",'i') then output;
have a good day
... View more
04-16-2020
04:47 AM
I cannot look into your server (if I could, I would either have the police knocking soon, or your IT people would all be fired), so you need to know where to put data in your system environment. Get help from your server administrators, they can tell you where to put data on the server (a good bet is always $HOME), and how to move the data from there to its final intended location.
... View more
04-15-2020
09:41 PM
Thanks mkeintz > that worked perfectly! Such a simple thing but I couldn't figure it out. Thanks again!
... View more
04-15-2020
05:45 AM
Why is duration_final = 24 for the last observation with patientID = 111? This does not match the description.
The log should contain syntax-errors for the lines 3-5 of your data-step. @kelxxx already explained the reason: a semicolon is required before "end;".
Keeping do...end-blocks is highly recommended, properly formatted those blocks increase readability and help avoiding common mistakes, when adding another statement that should be executed conditionally.
... View more
04-15-2020
03:40 AM
1 Like
The documentation for the FDELETE function is just one down from the one for FCOPY. Everything else is just a matter of conditions and date calculations, read: basic data step programming.
... View more
04-14-2020
01:01 PM
1 Like
Thank you...that worked and I learnt something new!!
... View more
04-14-2020
11:59 AM
data want;
set have;
length y $200;
y= prxchange('s/\[/strip(/',-1, x);
y= prxchange('s/\]/),/',-1, y);
y=prxchange('s/\(values=/VAR=COALESCE(/',-1, y);
y=prxchange('s/" *s/",s/',-1, y);
y=prxchange('s/, *\)/)/',-1, y);
run; a little modification
... View more
04-14-2020
10:29 AM
@ballardw wrote:
Where do those values come from and why do you think that they need to be in macro variables?
Agreed. Unless you have no control over the contents of the macro variable ... then %let group_1=(n=4); is a poor way to set things up; and its hard to see why macro variables are needed anyway.
... View more
- « Previous
-
- 1
- 2
- Next »