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

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?

  • The obvious solution is of course to take out two of the length statements which effectively fixes the warning. However I prefer not to do this since the models from E-Miner will be frequently updated and re-trained, meaning that the optimized code will be overwritten each time. This solution is therefore not suitable for automation purposes.
  • Might it be possible to fix the variable length in E-Miner itself ?

 

If this issue can not be solved easily, can I turn off warnings on variable length for that particular data step somehow?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

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.

 

 

 

 

View solution in original post

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

Have you tired to always have an I_TARGET variable with a length of 32 when building the model?

Data consistency avoids many headaches.

 

NickVe
Obsidian | Level 7

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?

ChrisNZ
Tourmaline | Level 20

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.

 

 

 

 

NickVe
Obsidian | Level 7

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.

NickVe
Obsidian | Level 7
As a follow up: Apparently this is a bug in Enterprise-Miner triggerd by the "ensemble model" node. If your target is numeric you can get multiple length statements in the optimized code.

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
  • 5 replies
  • 557 views
  • 1 like
  • 2 in conversation