02-10-2023
buckeyefisher
Obsidian | Level 7
Member since
04-24-2014
- 71 Posts
- 7 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by buckeyefisher
Subject Views Posted 2011 02-03-2023 05:29 PM 1515 03-06-2021 10:46 AM 1593 03-05-2021 06:08 PM 6683 10-16-2019 04:11 PM 6687 10-16-2019 04:07 PM 6712 10-16-2019 03:51 PM 630 06-05-2019 04:21 PM 671 06-05-2019 02:35 PM 1031 05-22-2017 11:22 AM 1130 05-20-2017 05:13 PM -
Activity Feed for buckeyefisher
- Posted Filling missing values with group and subgroup on SAS Programming. 02-03-2023 05:29 PM
- Liked Re: Importing multiple Excel files for Kurt_Bremser. 03-06-2021 02:52 PM
- Liked Re: Importing multiple Excel files for Kurt_Bremser. 03-06-2021 02:52 PM
- Posted Re: Importing multiple Excel files on SAS Enterprise Guide. 03-06-2021 10:46 AM
- Liked Re: Importing multiple Excel files for ballardw. 03-06-2021 09:54 AM
- Posted Importing multiple Excel files on SAS Enterprise Guide. 03-05-2021 06:08 PM
- Posted Re: Changing variables from upper to lower case on SAS Procedures. 10-16-2019 04:11 PM
- Posted Re: Changing variables from upper to lower case on SAS Procedures. 10-16-2019 04:07 PM
- Posted Changing variables from upper to lower case on SAS Procedures. 10-16-2019 03:51 PM
- Liked Re: Looping using 2 files for Ksharp. 06-07-2019 11:15 AM
- Posted Re: Looping using 2 files on New SAS User. 06-05-2019 04:21 PM
- Posted Looping using 2 files on New SAS User. 06-05-2019 02:35 PM
- Posted Re: How to extract specific 4 digits from large string where the location varies on SAS Programming. 05-22-2017 11:22 AM
- Posted How to extract specific 4 digits from large string where the location varies on SAS Programming. 05-20-2017 05:13 PM
- Posted Re: Counting Alliance partner unique diadic relationships on SAS Procedures. 09-06-2016 05:53 PM
- Posted Counting Alliance partner unique diadic relationships on SAS Procedures. 09-02-2016 10:29 AM
- Posted Re: SAS Proc means on SAS Procedures. 11-25-2015 10:43 AM
- Posted SAS Proc means on SAS Procedures. 11-25-2015 10:11 AM
- Posted Collapsing multiple columns into few on SAS Procedures. 10-10-2015 09:47 AM
- Posted multiple SET in PROC SQL on SAS Procedures. 10-08-2015 06:18 PM
-
Posts I Liked
Subject Likes Author Latest Post 3 1 1 1 1
02-03-2023
05:29 PM
I have the following data
Case_number
Company
party_role
1
A
Plaintiff
1
B
1
C
Defendant
1
D
2
E
Plaintiff
2
F
2
G
Defendant
2
H
I want the output to look like this.
Case_number
Company
party_role
1
A
Plaintiff
1
B
Plaintiff
1
C
Defendant
1
D
Defendant
2
E
Plaintiff
2
F
Plaintiff
2
G
Defendant
2
H
Defendant
I tried following code but not working
data want; set have; retain repeat1; if first.case_number then do; if party_role ne '' then repeat1 = party_role; else do; if party_role eq '' then party_role = repeat1; end; drop repeat1; end; run;
... View more
03-06-2021
10:46 AM
SYMBOLGEN: Macro variable SASWORKLOCATION resolves to
"C:\Users\AppData\Roaming\SAS\EnterpriseGuide\EGTEMP\SEG-19596-7410e0f1\contents\SAS Temporary
Files\_TD32504_MGTAWATE18D_\Prc2/"
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1 pubmed21n0060.xlsx 18
2 pubmed21n0061.xlsx 18
MLOGIC(MERGE): Beginning execution.
MLOGIC(MERGE): Parameter N has value 2
SYMBOLGEN: Macro variable N resolves to 2
MLOGIC(MERGE): %DO loop beginning; index variable I; start value is 1; stop value is 2; by value is 1.
SYMBOLGEN: Macro variable I resolves to 1
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable I resolves to 1
SYMBOLGEN: Macro variable FILE1 resolves to E:\abc\pubmed21n0060.xlsx
MPRINT(MERGE): proc import out=datafile1 datafile="E:\abc\pubmed21n0060.xlsx" dbms=xlsx replace;
MPRINT(MERGE): RXLX;
MPRINT(MERGE): getnames=yes;
MPRINT(MERGE): run;
MLOGIC(MERGE): %DO loop index variable I is now 2; loop will iterate again.
SYMBOLGEN: Macro variable I resolves to 2
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable I resolves to 2
SYMBOLGEN: Macro variable FILE2 resolves to E:\abc\pubmed21n0061.xlsx
MPRINT(MERGE): proc import out=datafile2 datafile="E:\abc\pubmed21n0061.xlsx" dbms=xlsx replace;
MPRINT(MERGE): RXLX;
MPRINT(MERGE): getnames=yes;
MPRINT(MERGE): run;
MLOGIC(MERGE): %DO loop index variable I is now 3; loop will not iterate again.
MPRINT(MERGE): data whole;
SYMBOLGEN: Macro variable N resolves to 2
MLOGIC(MERGE): %DO loop beginning; index variable J; start value is 1; stop value is 2; by value is 1.
SYMBOLGEN: Macro variable J resolves to 1
MLOGIC(MERGE): %DO loop index variable J is now 2; loop will iterate again.
SYMBOLGEN: Macro variable J resolves to 2
MLOGIC(MERGE): %DO loop index variable J is now 3; loop will not iterate again.
MPRINT(MERGE): set datafile1 datafile2 run;
ERROR: File WORK.RUN.DATA does not exist.
MLOGIC(MERGE): Ending execution.
77 ;*';*";*/;quit;run;
____
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
... View more
03-05-2021
06:08 PM
I have been using following code to import multiple excel files. But today its giving me this error - ERROR: File WORK.RUN.DATA does not exist. Tries looking up here but unable to resolve. Following is the code
----------------------------------------------------------------------------------------
options mprint mlogic symbolgen;
%macro merge(n); %do i=1 %to &n; proc import out=datafile&i datafile="&&file&i" dbms=xlsx replace; *sheet="xyz"; getnames=yes; run;
%end;
data whole; set %do j=1 %to &n; datafile&j %end; run;
%mend merge;
filename lib pipe 'dir "E:\abc\*.xlsx" /b'; data _null_; infile lib; input;list; run;
data file; length filenames $ 200; infile lib truncover; input filenames : $; filenames="E:\abc\"||filenames; run; data null; set file; call symputx('file'||put(_n_,8. -L ),filenames,'G'); run;
options sasautos=work; %merge(10)
... View more
10-16-2019
04:11 PM
Subsequent to this, I run some models in STATA which is case sensitive.
So far I was using SAS Enterprise 4.3 but recently shifted to SAS 7.1 and am wondering if something has changed.
... View more
10-16-2019
04:07 PM
To clarify, I want to change case of variable labels and not the contents in those variables. The code posted above is changing the contents and not the labels.
... View more
10-16-2019
03:51 PM
I have more than 400 variables in my dataset with mixed case (some upper and some lower). I want to change all of them to lowercase. I tried following but doesn't work. Can someone please help?
data want; set have; array vars(*) _character_; do i=1 to dim(vars); vars(i)=lowcase(vars(i)); end; drop i; run;
... View more
06-05-2019
04:21 PM
Thanks, following code is giving incorrect results. Do need to say BY after merge? data work.need; merge work.seta (in=ina) work.setb (in=inb) ; matched = (ina and inb); run;
... View more
06-05-2019
02:35 PM
I have 2 files and want to compare them to create a third file. The third file should have a summary record of matches.
Case number can repeat but subclasses in each file are unique per case number.
File A
Case_number subclass
5-10-cv-00123 434
5-10-cv-00123 451
5-10-cv-00123 478
2-10-cv-00599 510
2-10-cv-00599 512
File B
case_number subclass
5-10-cv-00123 221
5-10-cv-00123 434
2-10-cv-00599 510
2-10-cv-00599 512
Output needed
Case_number total subclass from A matched in B Match Flag
5-10-cv-00123 3 1 0
2-10-cv-00599 2 2 1
... View more
05-22-2017
11:22 AM
This also looks intersting. Thanks !!
... View more
05-20-2017
05:13 PM
I want to extract year (4 digits) from a string which alphanumeric. The location of the year varies.
The field name is 'Preclinical' that holds the string. Typical example of the string is
"In SHR, po doses of 1-10mg/kg produced an antihypertensive effect of gradual onset and sustained (>7hr) duration due to peripheral vasodilation. It also showed suppression of the pressor response to cold stress, due to presynaptic action on the sympathetic nerve (Company communication, Fujirebio, Mar 1995). Tachycardia and cardiac depression side-effects were weaker cf nifedipine."
I want to extract 1995 from the string to precdate2. I tried the following code. But I am not any values in the output field precdate2.
prx = prxparse("/(\s)(\d\d\d\d)(\s)/"); if prxmatch(prx, Preclinical) then do; precdate2 = prxposn(prx, 4, Preclinical); end;
... View more
09-06-2016
05:53 PM
Shumel,
Although I am yet to verify all possible combinations, initial results are promising.
Thanks,
... View more
09-02-2016
10:29 AM
I want to count diadic relationship between alliance partners per year.
Data have;
No Principal Firm Partner Firm Year
1 a b 1991
2 b c 1991
3 a x 1992
4 a b 1992
5 x a 1993
6 x z 1994
7 c b 1995
8 b a 1996
Data Want;
No Principal Firm Partner Firm Year Alliance History Count (Cumulative)
1 a b 1991 1
2 b c 1991 1
3 a x 1992 1
4 a b 1992 2
5 x a 1993 2
6 x z 1994 1
7 c b 1995 2
8 b a 1996 3
(Alliance between 'a' - 'b' and between 'b' -'a' should be treated as same)
I tried Proc SQL distinc, but just gives unique relationships. I need count at the diadic relationship level
Thanks,
... View more
11-25-2015
10:43 AM
Steelers_In_DC - I want to count unique countries. Hence, in 2002 KSA is counted once.
... View more
11-25-2015
10:11 AM
I want to summarize data in the following way. I explored Proc Means but couldn't figured out an option to do this.
Data have,
Company Year Country of operations
A 2000 GBR
A 2000 GBR
A 2000 USA
A 2001 FRA
A 2002 USA
A 2002 KSA
A 2002 RUS
A 2002 KSA
A 2003
B 2000
Data Want
Company Year Number of Countries represented
A 2000 2
A 2001 1
A 2002 3
A 2003
B 2000
Thanks,
... View more
10-10-2015
09:47 AM
I want to collapse multiple columsn (as some are empty) into few columsn to reduce size of the file.
Maximum columns populated in Have is 3 so poutput should have 3 columns and orignial 5 can be dropped
Have
Record Class1 Class2 Class3 Class4 Class5
1 A C
2 B
3 D E
4 A
5 B C D
Want
Record Classnew1 ClassNew2 ClassNew3
1 A C
2 B
3 D E
4 A
5 B C D
... View more