BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pearson101
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@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?

View solution in original post

3 REPLIES 3
ballardw
Super User

@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
Calcite | Level 5

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;

 

ballardw
Super User

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 804 views
  • 0 likes
  • 2 in conversation