02-08-2021
mmhxc5
Quartz | Level 8
Member since
01-03-2019
- 61 Posts
- 13 Likes Given
- 0 Solutions
- 2 Likes Received
-
Latest posts by mmhxc5
Subject Views Posted 826 01-27-2021 10:23 AM 1129 09-23-2020 04:15 PM 1015 08-06-2020 05:28 PM 1266 07-23-2020 05:29 PM 1296 07-23-2020 12:47 PM 1433 07-22-2020 05:19 PM 2396 06-24-2020 05:23 PM 2413 06-24-2020 04:01 PM 2438 06-24-2020 12:53 PM 2564 06-23-2020 10:44 AM -
Activity Feed for mmhxc5
- Got a Like for How to use black and white fill patterns for bar graphs in ODS Graphics Designer. 02-20-2024 06:48 AM
- Posted How to plot only a specific stratum from proc PHREG on Statistical Procedures. 01-27-2021 10:23 AM
- Posted How to combine multiple select statements under one PROC SQL on Statistical Procedures. 09-23-2020 04:15 PM
- Posted merge by two variables produce zero ouput observation on SAS Programming. 08-06-2020 05:28 PM
- Posted Re: choosing a value conditional on two different variables on SAS Programming. 07-23-2020 05:29 PM
- Posted Re: choosing a value conditional on two different variables on SAS Programming. 07-23-2020 12:47 PM
- Posted choosing a value conditional on two different variables on SAS Programming. 07-22-2020 05:19 PM
- Liked Re: Remove a specific letter and only the number following it for Patrick. 06-25-2020 12:18 PM
- Posted Re: Remove a specific letter and only the number following it on SAS Programming. 06-24-2020 05:23 PM
- Posted Re: Remove a specific letter and only the number following it on SAS Programming. 06-24-2020 04:01 PM
- Posted Re: Remove a specific letter and only the number following it on SAS Programming. 06-24-2020 12:53 PM
- Posted Re: Remove a specific letter and only the number following it on SAS Programming. 06-23-2020 10:44 AM
- Posted Re: Remove a specific letter and only the number following it on SAS Programming. 06-23-2020 10:37 AM
- Posted Re: Remove a specific letter and only the number following it on SAS Programming. 06-23-2020 10:23 AM
- Posted Remove a specific letter and only the number following it on SAS Programming. 06-23-2020 09:12 AM
- Posted Re: Proc tabulate does not export to excel - blank excel on New SAS User. 06-18-2020 01:35 PM
- Posted Re: Proc tabulate does not export to excel - blank excel on New SAS User. 06-17-2020 07:23 PM
- Posted Re: Proc tabulate does not export to excel - blank excel on New SAS User. 06-17-2020 06:09 PM
- Posted Re: Proc tabulate does not export to excel - blank excel on New SAS User. 06-17-2020 05:45 PM
- Posted Proc tabulate does not export to excel - blank excel on New SAS User. 06-17-2020 05:31 PM
-
Posts I Liked
Subject Likes Author Latest Post 2 4 2 1 1 -
My Liked Posts
Subject Likes Posted 1 12-17-2019 11:30 PM 1 05-03-2019 11:54 AM
01-27-2021
10:23 AM
Hi nice people, I am analyzing survival data using proc PHREG. The data has six strata. To prevent clutter and also show the difference in survival for continuous and categorical covariates graphically, I would like to only plot a single strata at two or three continuous covariate values or two or three categorical levels. I searched the community, but could not find such thing. I appreciate any help to take care of this. Thanks,
... View more
09-23-2020
04:15 PM
Hi all, Hope you all are doing great and stay safe during the pandemic. I would like to combine several "Select" statements where I calculate the average of the variables under one "Proc SQL". Below is the code I use and it works, but I use this code for each variable separately and producing unnecessary files. I want to get the average of other variables like length, age, ... for the same ID under this code. I appreciate your time and help.
... View more
08-06-2020
05:28 PM
Hi, I would like to merge two datasets by STRUCTURE_NUMBER_008 and Inspection_Year if available in both datasets and keep all the variables in the output. when I run the code, it gives zero observation from the merge statement. data SNOW_FIRNSA05;
merge all_data(in=one) snow_data(in=two) ;
by STRUCTURE_NUMBER_008 Inspection_Year;
if one;
run; The format for the BY Variables is the same, but I do not know why the code does not work. I appreciate the time and help I anyone could help me fix this error.
... View more
07-23-2020
05:29 PM
Hi @smantha , I revised a little bit of your code as below and it worked. if first.structure_id = 0 and first.year_reconstructed then do;
if condition > x and year_reconstructed ne 0 then year_to_subtract = Year_reconstructed; Thanks for your help!
... View more
07-23-2020
12:47 PM
@mkeintz, thank you for your help. Please see the output I want in my original post.
... View more
07-22-2020
05:19 PM
Hi all, Here is the scenario from the attached dataset. The variables are STRUCTURE_ID, YEAR_BUILT, YEAR_RECONSTRUCTED, Inspection_Year, and CONDITION. Each structure is inspected as shown in the Inspection_Year column. The data are sorted based on the STRUCTURE_ID and Inspection_Year. I would like to add another column Structure_Age based on the following conditions. If the structure is not reconstructed (YEAR_RECONSTRUCTED=0) or CONDITION data before reconstruction is not available then; Structure_Age = Inspection_Year - YEAR_BUILT If the structure is reconstructed, I want to see if the CONDITION is improved (higher CONDITION value than the year before YEAR_RECONSTRUCTED in CONDITION column. then, Structure_Age = Inspection_Year - YEAR_RECONSTRUCTED If the structure is reconstructed but the CONDITION is not improved (same CONDITION value as the year before YEAR_RECONSTRUCTED in CONDITION column. then, Structure_Age = Inspection_Year - YEAR_BUILT data want;
input STRUCTURE_ID $ YEAR_BUILT YEAR_RECONSTRUCTED INSPECTION YEAR CONDITION $ STRUCTURE_AGE;
cards;
/*STRUCTURE_AGE is 1983-1958 = 25 for CONDITION 5 below. */
1 1958 0 1983 5 25;
/*STRUCTURE_AGE is 1984-1958 = 26 for CONDITION 4 below.
The rest of CONDITION 4 are 0, I dont need it. */
1 1958 0 1984 4 26;
1 1958 0 1985 4 0;
1 1958 0 1986 4 0;
1 1958 0 1987 4 0;
1 1958 0 1988 4 0;
/* The structure is reconstructed in 1992 and CONDITION is improved in 1993 inspection
and it is different than 1988 CONDITION 4, therefore STRUCTIRE_AGE is 1993-1992 =1 as below.
For the rest of CONDITION 8, STRUCTURE_AGE = 0, I dont need it. */
1 1958 1992 1993 8 1;
1 1958 1992 1994 8 0;
1 1958 1992 1995 8 0;
/* The CONDITION drops to 7 in 1996 and STRCUTURE_AGE= 1196-1992 = 4 as below.
STRUCTURE_AGE for the rest of CONDITION 7 is 0, I dont need it. if the CONDIION changes
to 6, I need STRUCTURE_AGE to be computed, if not to be 0. */
1 1958 1992 1996 7 4;
1 1958 1992 1997 7 0;
1 1958 1992 1998 7 0;
1 1958 1992 1999 7 0;
1 1958 1992 2000 7 0;
1 1958 1992 2001 7 0;
/* The CONDITION in 1983 is 6 and STRUTURE_AGE = 1983 - 1937 = 46 and for the rest
of CODNTION 6 it is 0 as I don't need it. in 1990 the CONDIION is 5 and STRUCTURE_AGE
1990 - 1937 = 53 and for the rest of CONDITION 5 it is 0 as below. */
10027 1937 0 1983 6 46;
10027 1937 0 1984 6 0;
10027 1937 0 1985 6 0;
10027 1937 0 1986 6 0;
10027 1937 0 1987 6 0;
10027 1937 0 1988 6 0;
10027 1937 0 1989 6 0;
10027 1937 0 1990 5 53;
10027 1937 0 1991 5 0;
10027 1937 0 1992 5 0;
10027 1937 0 1993 5 0;
10027 1937 0 1994 5 0;
/* The bridge is reconstructed in 1994, but CONDITION is not improved in 1995, as it is
the same CONDITION as 1994 inspection,therefore STRCUTURE_AGE is 0 as below.*/
10027 1937 1994 1995 5 0; I appreciate your time and help!
... View more
06-24-2020
05:23 PM
@Tom, I really appreciate your help. I would like to attach the original data for you. If you scroll the data you will find the R and the digits following it. Could you please check your code for this original data? Thanks,
... View more
06-24-2020
04:01 PM
Hi @Patrick , Yes, I tried @Ksharp Suggestion. it works fine, but for characters starting with an R that I want to keep, the code removes those Rs.
... View more
06-24-2020
12:53 PM
Thank you, @Tom for your detailed description. you have pointed great issues for the date set.I updated the data set to include the cases you mentioned. data have;
input string $20.;
cards;
A 606R1 3
A 607R2 1
A 607R3 1
A 607R1 1
A 607R 1
A 607 1
400080
A 200
Z 400R
R 186 1
R 186R 1
R 186R1 1
;
data want;
input string $20.;
cards;
A 606 3
A 607 1
A 607 1
A 607 1
A 607 1
A 607 1
400080
A 200
Z 400
R 186 1
R 186 1
R 186 1
; Yes, I would like to keep the values without an R in my want data set. For the case where an R exist but not followed by a digit, I just want to remove the R. Also, I found that there are cases where the character starts with an R which I would like to keep. I would be grateful if you revise your code to account for the new cases I explained. Thank you,
... View more
06-23-2020
10:44 AM
Oh, Excuse me for the confusion my data made. The data I showed in my original post is just one column of a character variable not several variables.
... View more
06-23-2020
10:37 AM
You are right. The revision numbers are single digits just shown in the example.
... View more
06-23-2020
10:23 AM
Hi, I can not share the data due to confidentiality. I tested your code and it removes everything after R. I just want to remove the revision number beside R but not the numbers after the revision number as shown in my example. Thanks
... View more
06-23-2020
09:12 AM
Hi all, I would like to remove a specific letter and the number just following it, but not a similar number from a character format. data have; A 606R1 3 A 607R2 1 A 607R3 1 A 607R1 1 A 607R 1 data want; A 606 3 A 607 1 A 607 1 A 607 1 A 607 1 The data set is large. The R stands for revision and the number just following it the revision number. I want to remove the R and the number following it (not replacing it with space). There might be numbers following the revision number which I want to keep.
... View more
06-18-2020
01:35 PM
Hi, Here is the error from the code. 9 ods excel file='D:\Softwares\data.xlsx';
10 proc tabulate data=xx.data02 FORMAT=5.;
NOTE: Writing HTML Body file: sashtml1.htm
11 class Verification_Year Product_NUMBER;
12 var ID_availability;
13 table Verification_Year ALL, ALL ID_availability*Product_NUMBER;
14 run;
ERROR: There is not enough memory to perform class method OM_NEW(3) of
"SCRIPT.TCELL".
ERROR: The SAS System stopped processing this step because of insufficient
memory.
NOTE: There were 927313 observations read from the data set
XX.DATA02.
NOTE: At least one W.D format was too small for the number to be printed. The
decimal may be shifted by the "BEST" format.
NOTE: PROCEDURE TABULATE used (Total process time):
real time 22:37.82
cpu time 22:35.09
15 ods excel close;
NOTE: Writing EXCEL file: D:\Softwares\data.xlsx
... View more
06-17-2020
07:23 PM
I get the following error in the log. 9 ods excel file='D:\Softwares\data.xlsx';
10 proc tabulate data=xx.data02 FORMAT=5.;
NOTE: Writing HTML Body file: sashtml1.htm
11 class Verification_Year Product_NUMBER;
12 var ID_availability;
13 table Verification_Year ALL, ALL ID_availability*Product_NUMBER;
14 run;
ERROR: There is not enough memory to perform class method OM_NEW(3) of
"SCRIPT.TCELL".
ERROR: The SAS System stopped processing this step because of insufficient
memory.
NOTE: There were 927313 observations read from the data set
XX.DATA02.
NOTE: At least one W.D format was too small for the number to be printed. The
decimal may be shifted by the "BEST" format.
NOTE: PROCEDURE TABULATE used (Total process time):
real time 22:37.82
cpu time 22:35.09
15 ods excel close;
NOTE: Writing EXCEL file: D:\Softwares\data.xlsx
... View more