BookmarkSubscribeRSS Feed
acordes
Rhodochrosite | Level 12

I'm puzzled because the where clause in the proc summary works as expected but when using it a data step it doesn't execute giving the error:

 

NOTE: Running DATA step in Cloud Analytic Services.
NOTE: The DATA step will run in multiple threads.
NOTE: Duplicate messages output by DATA step:
(occurred 16 times)
ERROR: The action stopped due to errors.

 

options casdatalimit=all;
proc summary data=BUSIDEV.CANAL_RECOBRO_MOD2 noprint ;
where ( catx("_", lag_gestion, gestion) in (&combs.) or lag_gestion='' or recover_anything in (1 )) and
( (gestion="GT" and days_channel le 7) or (gestion="CO" and days_channel le 40) or (gestion="GD" and days_channel le 90) or (gestion="GJ" and days_channel le 15) 
or days_channel=.);
class lag_gestion gestion recover_anything / missing;
var days_channel;
output out=public.sumy3 mean= median= min= max= / autoname;
run;

data BUSIDEV.CANAL_RECOBRO_MOD3;
set BUSIDEV.CANAL_RECOBRO_MOD2(where=
(( catx("_", lag_gestion, gestion) in (&combs.) or lag_gestion='' or recover_anything in (1 )) and
( (gestion="GT" and days_channel le 7) or (gestion="CO" and days_channel le 40) or (gestion="GD" and days_channel le 90) or (gestion="GJ" and days_channel le 15) 
or days_channel=.))); 
run;

 

1 REPLY 1
acordes
Rhodochrosite | Level 12

Upadte, if I use the work directory (instead of the caslib) for both in and output file it works...

 

Strange, isn't it?

 

1    %studio_hide_wrapper;
82   data CANAL_RECOBRO_MOD3;
83   set CANAL_RECOBRO_MOD2(where=
84   (( catx("_", lag_gestion, gestion) in (&combs.) or lag_gestion='' or recover_anything in (1 )) and
85   ( (gestion="GT" and days_channel le 7) or (gestion="CO" and days_channel le 40) or (gestion="GD" and days_channel le 90) or
85 ! (gestion="GJ" and days_channel le 15)
86   or days_channel=.)));
87   run;
NOTE: There were 183347 observations read from the data set WORK.CANAL_RECOBRO_MOD2.
      WHERE (CATX('_', lag_gestion, gestion) in ('CO_CO', 'CO_GD', 'CO_GJ', 'GD_GD', 'GD_GJ', 'GJ', 'GJ_GJ', 'GT_CO', 'GT_GD', 
      'GT_GJ', 'GT_GT') or (lag_gestion=' ') or (recover_anything=1)) and (((gestion='GT') and (days_channel<=7)) or 
      ((gestion='CO') and (days_channel<=40)) or ((gestion='GD') and (days_channel<=90)) or ((gestion='GJ') and (days_channel<=15)) 
      or (days_channel=.));
NOTE: The data set WORK.CANAL_RECOBRO_MOD3 has 183347 observations and 81 variables.
NOTE: DATA statement used (Total process time):
      real time           3.59 seconds
      cpu time            3.65 seconds
      
88   
89   %studio_hide_wrapper;
100  
101  
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 825 views
  • 0 likes
  • 1 in conversation