BookmarkSubscribeRSS Feed
ali263
Calcite | Level 5

Hi, I`m kind of new and in my job someone did this code but now it doesn`t work and i have the following message:

 

 /* OPTIMIZE ENROLLMENT RECORDS */
2100      
2101       PROC OPTMODEL;
2102       SET<STRING> KEY;
2103      
2104       NUMBER ENRL_FLAG{KEY}, RENW_FLAG{KEY},
2105         ENRL_A{KEY}, RENW_A{KEY}, RISK_A{KEY}, PRST_A{KEY},
2106         AVG_EARN_PREM{KEY}, AVG_NET_COST{KEY}, IMP_PRIMA_NETA{KEY}, IMP_PRIMA_NETA_RATIO{KEY};
2107      
2108       READ DATA SCORED_DATASET_ENRL INTO  KEY=[UNI_KEY] ENRL_FLAG RENW_FLAG
54                                                         The SAS System                             16:47 Wednesday, March 4, 2020
2109             ENRL_A RENW_A RISK_A PRST_A
2110             AVG_EARN_PREM AVG_NET_COST IMP_PRIMA_NETA IMP_PRIMA_NETA_RATIO;
WARNING: Duplicate key <'35038405            _                    _                    _           .'> was read at observation 4.
WARNING: Duplicate key <'34531102            _                    _                    _           .'> was read at observation 21.
WARNING: Duplicate key <'34435430            _                    _                    _           .'> was read at observation 523.
WARNING: Duplicate key <'24337693            _                    _                    _           .'> was read at observation 2086.
WARNING: Duplicate key <'33126461            _                    _                    _           .'> was read at observation 2660.
WARNING: Duplicate key <'34325267            _                    _                    _           .'> was read at observation 2821.
WARNING: Duplicate key <'35187034            _                    _                    _           .'> was read at observation 3793.
WARNING: Duplicate key <'14509087            _                    _                    _           .'> was read at observation 4253.
WARNING: Duplicate key <'33381182            _                    _                    _           .'> was read at observation 4774.
WARNING: Duplicate key <'35394031            _                    _                    _           .'> was read at observation 6517.
WARNING: Duplicate key <'34995064            _                    _                    _           .'> was read at observation 6526.
WARNING: Duplicate key <'34925856            _                    _                    _           .'> was read at observation 6817.
WARNING: Duplicate key <'7096553             _                    _                    _           .'> was read at observation 8670.
WARNING: Duplicate key <'28337755            _                    _                    _           .'> was read at observation 8882.
WARNING: Duplicate key <'32124595            _                    _                    _           .'> was read at observation 8976.
WARNING: Duplicate key <'31003233            _                    _                    _           .'> was read at observation 9051.
WARNING: Duplicate key <'34868093            _                    _                    _           .'> was read at observation 9082.
WARNING: Duplicate key <'6899950             _                    _                    _           .'> was read at observation 9086.
WARNING: Duplicate key <'6737864             _                    _                    _           .'> was read at observation 9524.
WARNING: Duplicate key <'36569788            _                    _                    _           .'> was read at observation 9584.
WARNING: Duplicate key <'34594224            _                    _                    _           .'> was read at observation 9590.
WARNING: Duplicate key <'34461365            _                    _                    _           .'> was read at observation 9631.
WARNING: Duplicate key <'36257280            _                    _                    _           .'> was read at observation 9726.
WARNING: Duplicate key <'34933673            _                    _                    _           .'> was read at observation 9777.
WARNING: Duplicate key <'6227401             _                    _                    _           .'> was read at observation 9936.
NOTE: 911 duplicate keys were read.
NOTE: There were 656701 observations read from the data set WORK.SCORED_DATASET_ENRL.
NOTE: The maximum message limit was reached during execution of the statement block. 886 notes and warnings were not displayed.
2111      
2112       VAR PR_CHNG{T IN KEY} >= 0.90 <= 1.00;
2113      
2114       IMPVAR ENROLL_EST0{T IN KEY} = ENRL_FLAG[T] * 1/(1 + EXP(-(ENRL_A[T] + ((IMP_PRIMA_NETA_RATIO[T]) * -0.0742) +
2114     ! ((IMP_PRIMA_NETA[T]) * -0.00014))));
2115       IMPVAR ENROLL_EST1{T IN KEY} = ENRL_FLAG[T] * 1/(1 + EXP(-(ENRL_A[T] + ((IMP_PRIMA_NETA_RATIO[T]/PR_CHNG[T]) * -0.0742) +
2115     !  ((IMP_PRIMA_NETA[T]*PR_CHNG[T]) * -0.00014))));
2116       IMPVAR RISK_EST0{T IN KEY} = 1/(1 + EXP(-(RISK_A[T] + (0.5354))));
2117       IMPVAR RISK_EST1{T IN KEY} = 1/(1 + EXP(-(RISK_A[T] + (PR_CHNG[T] * 0.5354))));
2118       IMPVAR PERSIST_DAYS_EST0{T IN KEY} = EXP(PRST_A[T] + (((IMP_PRIMA_NETA_RATIO[T])**2) * 0.002826) + ((1**2) * 0.022864) +
2118     ! (LOG(1) * -0.055039) + (LOG(IMP_PRIMA_NETA[T]) * -0.063444));
2119       IMPVAR PERSIST_DAYS_EST1{T IN KEY} = EXP(PRST_A[T] + (((IMP_PRIMA_NETA_RATIO[T]/PR_CHNG[T])**2) * 0.002826) +
2119     ! ((PR_CHNG[T]**2) * 0.022864) + (LOG(PR_CHNG[T]) * -0.055039) + (LOG(IMP_PRIMA_NETA[T]*PR_CHNG[T]) * -0.063444));
2120       IMPVAR EARN_PREM0{T IN KEY} = ENROLL_EST0[T] * ((IMP_PRIMA_NETA[T]) / 365) * PERSIST_DAYS_EST0[T];
2121       IMPVAR EARN_PREM1{T IN KEY} = ENROLL_EST1[T] * ((IMP_PRIMA_NETA[T]*PR_CHNG[T]) / 365) * PERSIST_DAYS_EST1[T];
2122       IMPVAR RISK_COST0{T IN KEY} = ENROLL_EST0[T] * RISK_EST0[T] * AVG_NET_COST[T];
2123       IMPVAR RISK_COST1{T IN KEY} = ENROLL_EST1[T] * RISK_EST1[T] * AVG_NET_COST[T];
2124      
2125       MAX ISSUED_PREM = SUM{T IN KEY} ENROLL_EST1[T]*(IMP_PRIMA_NETA[T]*PR_CHNG[T]);
2126      
2127       CONSTRAINT PR_CHNG_CON_LB{T IN KEY}: 0.90 <= PR_CHNG[T] <= 1.00;
2128      
2129       SOLVE;
NOTE: Problem generation will use 12 threads.
NOTE: The problem has 655790 variables (0 free, 0 fixed).
NOTE: The problem uses 655790 implicit variables.
NOTE: The problem has 655790 linear constraints (0 LE, 0 EQ, 0 GE, 655790 range).
NOTE: The problem has 655790 linear constraint coefficients.
55                                                         The SAS System                             16:47 Wednesday, March 4, 2020
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The OPTMODEL presolver removed 0 variables, 655790 linear constraints, and 0 nonlinear constraints.
NOTE: The OPTMODEL presolved problem has 655790 variables, 0 linear constraints, and 0 nonlinear constraints.
NOTE: The OPTMODEL presolver removed 655790 linear constraint coefficients, leaving 0.
ERROR: Out of memory during code generation.
2130      
2131       CREATE DATA OPTDATA_ENRL FROM [UNI_KEY] = {KEY} PR_CHNG;
NOTE: The data set WORK.OPTDATA_ENRL has 655790 observations and 2 variables.
2132      
2133       QUIT;
ERROR: The SAS System stopped processing this step because of insufficient memory.
NOTE: PROCEDURE OPTMODEL used (Total process time):
      real time           23.91 seconds
      cpu time            36.41 seconds
 
After that i connect to TERADATA to write the info but for this error it doesn´t allowed it 
 
PLEASE HELP!!!!!!!
     

 

3 REPLIES 3
TomKari
Onyx | Level 15

Well, as it says, SAS ran out of memory!

 

There are a number of possibilities.

 

SAS has three memory size options, MAXMEMQUERY, MEMSIZE, and REALMEMSIZE. One of them may need to be adjusted. Unfortunately, that's a job that is generally done by someone with SAS experience. If you can find that person at your shop, ask them to give you a hand with changing these.

 

Also, do a search on your error message. I just did that, and a number of the hits discussed the nature of the model (I'm not experienced enough with OPTMODEL to have an opinion). Perhaps your request needs to be tweaked.

 

SAS has a wonderful Technical Support group. I typically wouldn't send someone with your problem to them, as I don't think it's a software issue, but because of your inexperience I think it might be necessary. Put in a track with them, and see what they say.

 

Make sure you post back with the solution so everyone else can learn from it!

   Tom

ali263
Calcite | Level 5

Hi Tom, 

 

I actually find out about the three memory size options and I have this: 

 

SUMSIZE=4294967296
                   Specifies a limit on the amount of memory that is available for data summarization procedures when class
                   variables are active.
 MAXMEMQUERY=268435456
                   For certain procedures, specifies the maximum amount of memory that can be allocated per request.
 LOADMEMSIZE=0     Specifies a suggested amount of memory that is needed for executable programs loaded by SAS.
 MEMSIZE=4294967296
                   Specifies the limit on the amount of virtual memory that can be used during a SAS session.
 REALMEMSIZE=4294967296
                   Specifies the amount of real memory SAS can expect to allocate.
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds

 

i don´t know if thats enough to run my process but if not who can actually help me or how can I contact the SAS  Technical Support group. 

 

Thanks a lot for your help 🙂

TomKari
Onyx | Level 15

Go to support.sas.com, down a bit there's a button for "Technical Support". Click it. You've done 1 and 2, so click 3 "Contact Technical Support", and you'll be guided into a dialogue to get in touch with them. I suggest you follow the "Create a Track" stream, it's what I always do and it works well.

 

I've had excellent support from them for over 20 years. Good luck!

   Tom

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 971 views
  • 1 like
  • 2 in conversation