When I try to use the SAS optimized code in my datastep, i get the warning below:
"WARNING: Length of character variable I_TARGET has already been set. "
When looking at the sas file itself, I see that the optimized code has three different length statements for the variable I_TARGET, each with a different value for the length ($32, $16 and $32).
Is there an easy way to fix this issue?
If this issue can not be solved easily, can I turn off warnings on variable length for that particular data step somehow?
I don't have EM, sorry.
So you give EM a $32 variable and it spits out a $16 target variable?
If that's the case:
1. It seems wrong to me and you may want to ask tech support to reference this issue for the developers to fix.
2. You need to fix it yourself sadly
>If this issue can not be solved easily, can I turn off warnings on variable length for that particular data step somehow?
options varlenchk = nowarn;
Be careful that if length ITARGET $16; comes first, you might end up with truncated values.
I would be reluctant to use that option.
Have you tired to always have an I_TARGET variable with a length of 32 when building the model?
Data consistency avoids many headaches.
Hi ChrisNZ,
I completely agree with you, this was actually also what I meant with the question "Might it be possible to fix the variable length in E-Miner itself ?".
The variable I_TARGET is a variable that is generated by SAS itself in E-Miner for the model evaluation. Now I have been looking for some time where I could configure this variable in SAS, but unfortunately I have not found it yet.
Do you perhaps know where I could set this variable length in E-Miner?
I don't have EM, sorry.
So you give EM a $32 variable and it spits out a $16 target variable?
If that's the case:
1. It seems wrong to me and you may want to ask tech support to reference this issue for the developers to fix.
2. You need to fix it yourself sadly
>If this issue can not be solved easily, can I turn off warnings on variable length for that particular data step somehow?
options varlenchk = nowarn;
Be careful that if length ITARGET $16; comes first, you might end up with truncated values.
I would be reluctant to use that option.
Hey CrhisNZ,
No problem, I would have probably answered the same if I did not know E-miner. I am already very thankful for the information you have provided.
I share your concern considering turning off the warings. I would rather solve the problem than the symptoms since this is better for maintainability. I will check in with SAS support as well, maybe they might have a solution for this issue.
I will keep this thread open for one more week. If there is no new answer in this time I will mark your answer as the solution since it essentially solves my problem.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.