Recently in the SAS Community Library: Your often contains the information you need, but not sequenced in the order required for processing. @SASJedi shows you how to properly sequence data so you can compare the data in one table to the data in another, conduct merges or joins and more.
Hi guys,
suppose to have the following dataset DB. Is there a way to get DB1? In other words where there are repeated (identical) dates the Index should be 1. NB: all IDs have only one record (row) where Index = 1.
Thank you in advance
data DB;
input ID :$20. Admission :date09. Discharge :date09. Index;
format Admission date9. Discharge date9.;
cards;
0001 13JAN2017 25JAN2017 0
0001 13JAN2017 25JAN2017 1
0001 22FEB2018 03MAR2018 0
0001 30JAN2019 04MAR2019 0
0002 01DEC2018 14DEC2018 1
0002 01DEC2018 14DEC2018 0
0003 09JAN2016 25JAN2016 1
0003 29JAN2018 12FEB2018 0;
run;
data DB1;
input ID :$20. Admission :date09. Discharge :date09. Index;
format Admission date9. Discharge date9.;
cards;
0001 13JAN2017 25JAN2017 1
0001 13JAN2017 25JAN2017 1
0001 22FEB2018 03MAR2018 0
0001 30JAN2019 04MAR2019 0
0002 01DEC2018 14DEC2018 1
0002 01DEC2018 14DEC2018 1
0003 09JAN2016 25JAN2016 1
0003 29JAN2018 12FEB2018 0;
run;
... View more
How do I export a missing string variable to a json file as null rather than ""? SAS Code: data mydata;
INFILE DATALINES DLM='|';
Length CODE 3 Name $ 50;
Input CODE Name;
datalines;
11|Bob
12|Joe
13|Larry
;
run;
data newdata;
length status $2.;
format status $2.;
informat status $2.;
set mydata;
if name = "Joe" then
do;
status=.;
code=.;
end;
else status='Y';
run;
proc json out="P:\newdata.json" pretty NOSASTAGS;
export newdata;
run; Here's what the exported json looks like: [
{
"status": "Y",
"CODE": 11,
"Name": "Bob"
},
{
"status": "",
"CODE": null,
"Name": "Joe"
},
{
"status": "Y",
"CODE": 13,
"Name": "Larry"
}
] Here's what I want (i.e. status for Joe should be null rather than "": [
{
"status": "Y",
"CODE": 11,
"Name": "Bob"
},
{
"status": null,
"CODE": null,
"Name": "Joe"
},
{
"status": "Y",
"CODE": 13,
"Name": "Larry"
}
]
... View more
This is the code ods output Quartiles= median_ci(where=(percent=50));
proc lifetest data=test;
time duration*censor(1);
strata group;
run; It runs, but in results for quartile estimates it only shows complete data (point estimate, 95 CI) for the percent 25. There is no point estimate for 50 or 75. For this percents, it only shows the lower CI. Is this something to do with the data? Should I calculate the median and CI with another proc? The median and CI are to describe survival data. Any help is appreciated.
... View more
A new update is available for SAS Enterprise Guide , version 8.4 : Hot Fix: N3A001 - Published 24JUN2024 , Download link for N3A001 Component name: SAS Enterprise Guide Related SAS release: 9.4 Issues addressed in N3A001 This list of notes might be incomplete. For a complete list of issues addressed by this hot fix, visit the hot fix page for N3A001 Note: A comprehensive list of all SAS hot fixes is available from support.sas.com. You can use the SAS Hot Fix Analysis, Download, and Deployment (SASHFADD) tool to manage your SAS hot fixes.
... View more
A new update is available for SAS Job Monitor Administration , version 2.2_M2 : Hot Fix: M7T002 - Published 24JUN2024 , Download link for M7T002 Component name: SAS Job Monitor Administration Related SAS release: 9.4 Issues addressed in M7T002 This list of notes might be incomplete. For a complete list of issues addressed by this hot fix, visit the hot fix page for M7T002 Note: A comprehensive list of all SAS hot fixes is available from support.sas.com. You can use the SAS Hot Fix Analysis, Download, and Deployment (SASHFADD) tool to manage your SAS hot fixes.
... View more