The code that I am trying to execute in a job scheduled in SasStudio, executes successfully, but when I schedule it in an automatic job it ends when trying a DATA step that includes the CATX function, do I have to add any option for this type of functions run?
Thank you very much in advance.
Cheers
What does the log look like?
What exactly does "do not execute" mean? The job never starts? Starts but fails? Only that data step does not run (should be something in the log)?
Show the code using the CATX function.
If you are using CATX with macro variables then you may have to turn on Options MPRINT SYMBOLGEN; to see what is happening in the log.
What does the registry look like?
The variables are date type
What exactly does "do not run" mean? Does the work never start? Does it start but fail? Just that data pass not executing (there should be something in the log)?
It starts but fails, only this step fails.
It shows the following error:
Error:
71-185: The call to the CATX function does not have enough arguments.
Show the code using the CATX function.
data C_Cod_GrupoInfra (keep = PERSINVOL_TIPOIDENT_IDTIPIDE PERSINVOL_NRODOCUME Cod_GrupoInfra);
set Cod_GrupoInfra; length Cod_GrupoInfra $ 1000;
Cod_GrupoInfra = catx ('|', from col :);
run;
Thanks a lot 🙂
@Jhonarsalina wrote:
What does the registry look like?
The variables are date typeWhat exactly does "do not run" mean? Does the work never start? Does it start but fail? Just that data pass not executing (there should be something in the log)?
It starts but fails, only this step fails.
It shows the following error:
Error:
71-185: The call to the CATX function does not have enough arguments.Show the code using the CATX function.
data C_Cod_GrupoInfra (keep = PERSINVOL_TIPOIDENT_IDTIPIDE PERSINVOL_NRODOCUME Cod_GrupoInfra);
set Cod_GrupoInfra; length Cod_GrupoInfra $ 1000;
Cod_GrupoInfra = catx ('|', from col :);
run;Thanks a lot 🙂
I don't know if your input data set has any variables whose names start with COL . Also "from" is not going to work, the syntax would use OF.
See this example:
data example; input a1 $ a2 $ a3 $; result = catx('|',of a:); datalines; A b c pdq mno rst ;
Sorry the code is as follows:
Data C_COMPAREND_FECHINFRA (keep = PERSINVOL_TIPOIDENT_IDTIPIDE PERSINVOL_NRODOCUME COMPAREND_FECHINFRA);
set COMPAREND_FECHINFRA_F ; length COMPAREND_FECHINFRA $1000 ;
COMPAREND_FECHINFRA = catx( '|' , of col: ) ;
run;
It was the translator's fault.
So that error means that there are no variables whose name start with the letters COL.
See this example:
708 data test; 709 set sashelp.class ; 710 length x $200; 711 x = catx('|',of col:); ---- 71 ERROR 71-185: The CATX function call does not have enough arguments. 712 run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.03 seconds
You really should fix (or trap) the error before getting to this step.
But if you don't care then just add another value to the function call so that it always has at least one value to concatenate. Use a missing value and it will not change the results.
713 data test; 714 set sashelp.class ; 715 length x $200; 716 x = catx('|',.,of col:); 717 run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.TEST has 19 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
One possible explanation for the error is the dataset COMPAREND_FECHINFRA_F does not contain any variables named starting with "COL". Try adding this prior to the CATX step and run it as a scheduled job:
proc contents data = COMPAREND_FECHINFRA_F;
run;
Thank you all very much for your answers,
I opened a ticket and they are reviewing the case, it seems that there is some problem with the jobs in the software installation, the problem is not with the code, since in SasStudio it ends successfully.
Cheers
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.