12-31-2021
Feefee
Calcite | Level 5
Member since
03-15-2021
- 12 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Feefee
Subject Views Posted 1554 12-21-2021 11:38 AM 1570 12-21-2021 07:12 AM 1595 12-21-2021 05:31 AM 1596 12-21-2021 05:29 AM 1667 12-01-2021 11:37 AM 1722 12-01-2021 08:53 AM 463 04-09-2021 06:53 AM 479 04-09-2021 06:44 AM 1282 03-15-2021 09:15 AM 1311 03-15-2021 09:10 AM -
Activity Feed for Feefee
- Posted Re: Find pairs of a single variable from first and last on SAS Programming. 12-21-2021 11:38 AM
- Posted Re: Find pairs of a single variable from first and last on SAS Programming. 12-21-2021 07:12 AM
- Posted Re: Find pairs of a single variable from first and last on SAS Programming. 12-21-2021 05:31 AM
- Posted Re: Find pairs of a single variable from first and last on SAS Programming. 12-21-2021 05:29 AM
- Posted Re: Find pairs of a single variable from first and last on SAS Programming. 12-01-2021 11:37 AM
- Liked Re: Find pairs of a single variable from first and last for EyalGonen. 12-01-2021 10:21 AM
- Posted Find pairs of a single variable from first and last on SAS Programming. 12-01-2021 08:53 AM
- Posted Re: Output both observations in a merge if they match on SAS Programming. 04-09-2021 06:53 AM
- Posted Output both observations in a merge if they match on SAS Programming. 04-09-2021 06:44 AM
- Posted Re: Delimiter(Pipe) not being read if embedded in double or single quotes on SAS Programming. 03-15-2021 09:15 AM
- Posted Re: Delimiter(Pipe) not being read if embedded in double or single quotes on SAS Programming. 03-15-2021 09:10 AM
- Posted Re: Delimiter(Pipe) not being read if embedded in double or single quotes on SAS Programming. 03-15-2021 09:04 AM
- Posted Delimiter(Pipe) not being read if embedded in double or single quotes on SAS Programming. 03-15-2021 08:51 AM
-
Posts I Liked
Subject Likes Author Latest Post 1
12-21-2021
11:38 AM
data have;
input element$ 1-2 qt;
datalines;
A 1
B 2
Cc3
D 4
Ee5
;
data want;
set have end=last nobs=nobs;
array x{999} $ 32 _temporary_;
x{_n_}=element;
if last then do;
do i=1 to nobs-1;
var1=x{i};
do j=i+1 to nobs;
var2=x{j};output;
end;
end;
end;
keep var1 var2;
run; I found this, and it works but I want to apply this to each User_ID and not the entire list. I am trying method with first and last but I am getting null pointer exception. This is what I have so far: data want;
set have;
retain total_rows 0 a 1;
by User_ID;
total_rows = total_rows +1;
a = a +1;
if first.User_ID then do;
a=1;
array x{999} $ 32 _temporary_;
x{_n_}=dates;
end;
if last.User_ID then do;
do i = 1 to total_rows-1;
dates=x{i};
do j=rownum+1 to total_rows;
var2=x{j};
output;
end;
end;
end;
run; It works find until the do = i bit.. I have formatted etc its just the last bit I am struggling to get 😞
... View more
12-21-2021
07:12 AM
I'm getting a redefinition of local variable error. Also, I am not using sas but a similar product and the sql isnt very liked. So I am trying to write it in a datastep instead but struggling. Any help would be appreciated please 🙂
... View more
12-21-2021
05:31 AM
Hi, Thank you for your response. How would I do this in data steps instead of proc sql please? I am not using sas directly and proc sql isn't working properly unfortunately,
... View more
12-21-2021
05:29 AM
Hi, Thank you for your response. How would I do this in data steps instead of proc sql please?
... View more
12-01-2021
11:37 AM
Hi thanks for the info. I am getting a java.lang.ArrayIndexoutofboundsexception: 10 error 😕 How can i fix that please?
... View more
12-01-2021
08:53 AM
Hi guys, Need some help with this please! If I have the following data User ID Dates 23576 08/10/1998 23576 08/11/1998 23576 08/12/2000 23576 09/10/1998 85028 07/09/1976 85028 07/10/1967 85028 10/07/1967 13857 19/03/2001 13857 18/03/2001 What I want is all possible pairs of the dates associated with that user ID. So for ID 23576 I would want table like this: User ID Date A Date B 23576 08/10/1998 08/11/1998 23576 08/10/1998 08/12/2000 23576 08/10/1998 09/10/1998 23576 08/11/1998 08/12/2000 23576 08/11/1998 09/10/1998 23576 08/12/2000 09/10/1998 Hope that makes sense. Thank you so much!
... View more
04-09-2021
06:44 AM
Hi Guys! Quick question on merging and joining datasets: If I have two datasets and if they both have a matching obs (by a certain key), how can i output both observations from each dataset into my output dataset please?
... View more
03-15-2021
09:15 AM
Yeah, I did try that, but some of my data is empty/missing in between delimiters so it would simply ignore it which causes further issues 😞
... View more
03-15-2021
09:10 AM
Yes, you are correct. I would like my data to be parsed like this: a b c d Mr John Smith e f I would ideally like that the double or single quotes don't hinder the delimiter. Would you know how to go around this please?
... View more
03-15-2021
09:04 AM
That just messes up the data further as there are some values missing in between the delimiter. Thank you for responding though!
... View more
03-15-2021
08:51 AM
Hi Guys, Need some help please! I am trying to import a .dat file into SAS using infile. The data is pipe(|) delimited. However some of the data is like the following: a|b|c|d|"Mr John|Smith"|e|f|. As you can see the delimiter is embedded in between two data columns but in between double quotes (there are some with single quotes too). How can I get around this so that the delimiter is recognised and the data is imported correctly? Example of my data step: data library.file; infile "filepath" DLM = '|' DSD MISSOVER firstobs=3; format var1 $99. var2 $99. var3 $99. var4 $99. firstname $99. surname $99. var5 $99. var6 $99. ; input var1 $ var2 $ var3 $ var4 $ firstname $ surname $ var5 $ var6 $ ; run; Thank you!
... View more