12-23-2022
RandyStan
Fluorite | Level 6
Member since
03-09-2017
- 99 Posts
- 0 Likes Given
- 0 Solutions
- 1 Likes Received
-
Latest posts by RandyStan
Subject Views Posted 1282 12-23-2022 02:15 PM 1301 12-23-2022 02:01 PM 533 12-22-2022 10:41 AM 1250 12-19-2022 02:52 PM 393 10-10-2022 10:55 PM 1127 10-07-2022 02:10 PM 447 10-07-2022 12:29 PM 775 10-05-2022 01:37 PM 691 10-05-2022 12:21 PM 818 10-03-2022 11:36 PM -
Activity Feed for RandyStan
- Posted Re: Removing Duplicates by ID 1 on SAS Programming. 12-23-2022 02:15 PM
- Posted Removing Duplicates by ID 1 on SAS Programming. 12-23-2022 02:01 PM
- Posted Removing Duplicates by classes on SAS Programming. 12-22-2022 10:41 AM
- Posted Changing Format and Informat on SAS Programming. 12-19-2022 02:52 PM
- Posted Importing Files on SAS Programming. 10-10-2022 10:55 PM
- Posted Dropping a group while taking the mean on SAS Programming. 10-07-2022 02:10 PM
- Posted If then statement with conditions on SAS Programming. 10-07-2022 12:29 PM
- Posted First and last observations on SAS Programming. 10-05-2022 01:37 PM
- Posted Re: Forming time groups on SAS Programming. 10-05-2022 12:21 PM
- Posted Forming time groups on SAS Programming. 10-03-2022 11:36 PM
- Posted Re: Difference between days on SAS Programming. 07-11-2021 11:37 AM
- Posted Re: Difference between days on SAS Programming. 07-11-2021 10:05 AM
- Posted Difference between days on SAS Programming. 07-10-2021 11:47 AM
- Posted Extracting ID's on SAS Programming. 02-10-2021 10:06 AM
- Posted Re: Splitting a data set into many different files on SAS Programming. 02-09-2021 12:45 PM
- Posted Splitting a data set into many different files on SAS Programming. 02-09-2021 09:25 AM
- Posted Outputting variable value on SAS Programming. 11-03-2020 11:21 PM
- Got a Like for Previous observatio as last observation if missing. 10-25-2020 01:19 AM
- Posted Previous observatio as last observation if missing on SAS Programming. 10-25-2020 01:07 AM
- Posted Re: Filling in missing Values on SAS Programming. 10-19-2020 05:11 PM
-
My Liked Posts
Subject Likes Posted 1 10-25-2020 01:07 AM
12-23-2022
02:15 PM
Sincere apologies Row IDA IDB Cat VarA 1 A 1 1 7 2 A 1 1 9 3 B 1 1 7 4 B 1 1 10 5 B 2 1 11 6 A 1 2 12 7 A 1 2 14 8 A 2 2 16 9 C 1 3 12 10 C 1 3 14 Row IDA IDB Cat VarA 1 A 1 1 7 3 B 1 1 7 5 B 2 1 11 6 A 1 2 12 8 A 2 2 16 9 C 1 3 12
... View more
12-23-2022
02:01 PM
Dear All My data is as follows IDA IDB Cat VarA A 1 1 7 A 1 1 9 B 1 1 7 B 1 1 10 B 2 1 11 A 1 2 12 A 1 2 14 A 2 2 16 C 1 3 12 C1 1 3 14 I want the following table as output removing the duplicates and just keeping the first observation for IDA IDB for each CAT IDA IDB Cat VarA A 1 1 7 B 1 1 7 B 2 1 11 A 1 2 12 A 2 2 16 C 1 3 12 The code I wrote was proc sort data = have; by IDA IDB Cat ; run; data want ; set have by IDA IDB Cat ; if first.Cat then output ; run; Am I making a mistake somewhere? run;
... View more
12-22-2022
10:41 AM
Dear All My Data is as follows ID VarA Cat A 5 1 A 6 1 A 4 1 B 3 1 B 7 1 D 6 2 D 1 2 E 7 2 G 4 3 I want to keep just one ID from each CAT So my data should look like ID VarA Cat A 5 1 B 3 1 D 6 2 E 7 2 G 4 3 Can someone please help Thanks in advance Randy
... View more
12-19-2022
02:52 PM
Dear All: I have two variables and I want to change the format and informat of these variable VarA has Format BEST12. INFORMAT BEST32. I want to change it to BEST12. and BEST12. Var_B has $13. as the format and $13. as the INFORMAT I want to change it to $12. as the format and $12. as the Informat Can someone please help Randy
... View more
10-10-2022
10:55 PM
Dear All: Var_A Var_B Var_C Var_D 1003 1000Z ACZ PET 1006 400BA PQR DON The Code I wrote: Infile 'C:\Temp\have.csv' DLM = ',' Lrecl = 32000 DSD Truncover firstobs = 1; Input Var_A Var_B Var_C Var_D $50.; run; What is the mistake that I am making? Thank you in advance
... View more
10-07-2022
02:10 PM
Dear All: My SAS Data is as follows Date Group Var_A 02OCT2020 0 22 02OCT2020 1 28 02OCT2020 2 33 03OCT2020 0 55 03OCT2020 1 75 03OCT2020 2 86 I want to take the mean of VAR_A by excluding Group 0 from the calculation. There is a long method of doing this by creating a new data set excluding 0. Is there a shorter way to do this so that I can preserve the data set. Thanks much
... View more
10-07-2022
12:29 PM
Dear All: I am trying a IF/THEN statement and I do not seem to get the syntax. The conditions are as follows If Year < 2015 and date not between 24SEP2014 and 08OCT2014 and Group_ID >15 then Group_ID = 14 Data want ; set have ; if Year <2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID > 15 then do; Group_ID = 14; run; I do not seem to get the date statement correctly. Please help. Thanks in advance
... View more
10-05-2022
01:37 PM
Dear All: May data set is as follows Date ID VarA Interval 01JAN 2019 A 22 1 01JAN 2019 A 26 1 01JAN 2019 A 21 1 01JAN 2019 A 24 2 01JAN 2019 A 27 2 01JAN 2019 B 19 1 01JAN 2019 B 23 1 01JAN2019 B 16 7 02JAN 2019 A 95 1 02JAN 2019 A 62 1 02JAN 2019 A 21 1 02JAN 2019 A 43 2 02JAN 2019 A 51 2 02JAN 2019 B 33 1 02JAN 2019 B 45 5 02JAN2019 B 56 5 I want my data to be as follows: Date ID Interval VarA_FO VarA_LO 01JAN 2019 A 1 22 21 01JAN 2019 A 2 24 27 01JAN 2019 B 1 19 23 01JAN2019 B 7 16 16 /* FO = LO */ 02JAN 2019 A 1 95 21 02JAN 2019 A 2 43 51 02JAN 2019 B 1 33 33 /* FO = LO */ 02JAN 2019 B 5 45 56 Thanks in advance. Randy
... View more
10-03-2022
11:36 PM
Dear All: Here is the code I wrote: Data want ; set have; if Year < 2015 then VarA = INTCK ('Minute25.' , '10:00:00't , time); else if year >= 2015 then VarA = INTCK ('Minute25.' , '09:15:00't, time) ; run; I cannot get the 25 minute intervals starting at different times for the different years. What mistake am I making? Randy
... View more
07-11-2021
11:37 AM
I hope this is what was wanted. Thanks much data WDBV; input ID date DATE9. ; cards ; 1 01JUL2021 1 02JUL2021 1 06JUL2021 1 09JUL2021 2 02MAR2021 2 09MAR2021 2 12MAR2021 3 14MAY2021 ; What I need is ID Date Work_Days_Between_Visits 1 01JUL2021 1 02JUL2021 0 1 06JUL2021 0 1 09JUL2021 2 2 02MAR2021 2 09MAR2021 4 2 12MAR2021 2 3 14MAY2021
... View more
07-11-2021
10:05 AM
Thank you. I want the first value to be a NULL value. So I randomly chose -50000. The date format is DATE9. SAS date format. The file is attached.. In this file I left the first cell of each ID blank to indicate a NULL value. Thank you so much
... View more
07-10-2021
11:47 AM
Dear All: My data is as follows: ID Date 1 01JUL2021 1 02JUL2021 1 06JUL2021 1 09JUL2021 2 02MAR2021 2 09MAR2021 2 12MAR2021 3 14MAY2021 I want Work Days Between Trades and my data should be as follows. The first observation of each ID should be -50000 ID Date Work_Days_Between_Visits 1 01JUL2021 -50000 1 02JUL2021 0 1 06JUL2021 0 /* 5 July was a Holiday*/ 1 09JUL2021 2 2 02MAR2021 -50000 2 09MAR2021 4 2 12MAR2021 2 3 14MAY2021 -50000 Please Help. And Thanks in Advance
... View more
02-10-2021
10:06 AM
Dear All: I have over a hundred ID values. I want to extract just 5 to conduct a preliminary analysis. The code I wrote Proc sort data = have ; by ID ; run; Data want; set have; If ID = '345' or ID = '650' or ID = '656' or ID = '700' or ID = '725' then output; run; Is there a shorter way of writing this code to extract the first 5 ID values. Randy
... View more
02-09-2021
12:45 PM
Dear All Just to clarify I want to split the data into files both in SAS and CSV format Thank you
... View more