Hello,
I was able to produce the graph I wanted but now its' not working. I want to create a sgpanel eventually. I tried proc x11 but I get the following error after the procx11 section.
````
proc sort data=causerie_t_total_mean_all;
by date district;
run;
proc x11 data = causerie_t_total_mean_all noprint;
monthly additive date = date;
id district;
var mean_coldcough_rate;
tables a1 d12;
output out = test_all_cold a1 = mean_coldcough_rate d12 = adj;run;
```
````
ERROR: Date variable out of sequence for observation 45. Previous date: AUG2020; current date JAN2016.
ERROR: Date variable out of sequence for observation 101. Previous date: AUG2020; current date
OCT2016.
ERROR: Date variable out of sequence for observation 148. Previous date: AUG2020; current date
JAN2017.
ERROR: Date variable out of sequence for observation 192. Previous date: AUG2020; current date
JAN2018.
ERROR: Date variable out of sequence for observation 224. Previous date: AUG2020; current date
JAN2017.
````
What does this error mean and how can it be fixed?
@pearson101 wrote:
Hello,
I was able to produce the graph I wanted but now its' not working. I want to create a sgpanel eventually. I tried proc x11 but I get the following error after the procx11 section.
````
proc sort data=causerie_t_total_mean_all;
by date district;
run;
proc x11 data = causerie_t_total_mean_all noprint;
monthly additive date = date;
id district;
var mean_coldcough_rate;
tables a1 d12;
output out = test_all_cold a1 = mean_coldcough_rate d12 = adj;run;```
````
ERROR: Date variable out of sequence for observation 45. Previous date: AUG2020; current date JAN2016.
ERROR: Date variable out of sequence for observation 101. Previous date: AUG2020; current date
OCT2016.
ERROR: Date variable out of sequence for observation 148. Previous date: AUG2020; current date
JAN2017.
ERROR: Date variable out of sequence for observation 192. Previous date: AUG2020; current date
JAN2018.
ERROR: Date variable out of sequence for observation 224. Previous date: AUG2020; current date
JAN2017.````
What does this error mean and how can it be fixed?
If means that the sequence of dates is out of order for the way the procedure expects to use them
Examine the data around those records generating the error. Does District change?
@pearson101 wrote:
Hello,
I was able to produce the graph I wanted but now its' not working. I want to create a sgpanel eventually. I tried proc x11 but I get the following error after the procx11 section.
````
proc sort data=causerie_t_total_mean_all;
by date district;
run;
proc x11 data = causerie_t_total_mean_all noprint;
monthly additive date = date;
id district;
var mean_coldcough_rate;
tables a1 d12;
output out = test_all_cold a1 = mean_coldcough_rate d12 = adj;run;```
````
ERROR: Date variable out of sequence for observation 45. Previous date: AUG2020; current date JAN2016.
ERROR: Date variable out of sequence for observation 101. Previous date: AUG2020; current date
OCT2016.
ERROR: Date variable out of sequence for observation 148. Previous date: AUG2020; current date
JAN2017.
ERROR: Date variable out of sequence for observation 192. Previous date: AUG2020; current date
JAN2018.
ERROR: Date variable out of sequence for observation 224. Previous date: AUG2020; current date
JAN2017.````
What does this error mean and how can it be fixed?
If means that the sequence of dates is out of order for the way the procedure expects to use them
Examine the data around those records generating the error. Does District change?
Yes the district changes, I want to be able to do a sgpanel by district using this code, so i thought it needed to have dates per district.:
proc sgpanel data=test_all_mal_con;
panelby district / novarname ;
rowaxis label='Number of malaria cases per 1000';
vline date / response=mean_malaria_rate legendlabel= "Number of malaria cases per 1000";
vline date / response=adj markers markerattrs=(color=blue symbol='circle') lineattrs=(color=blue) legendlabel="trend cycle";
colaxis fitpolicy=thin Values=('01JAN2017'd to '01AUG020'd by month);
run;
ods listing;
So it appears that the input data set to Proc X11 wants one sort order.
Sort the OUTPUT of the proc before the SGPanel as needed.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.