Hi,
I have to call those lines (among others) with %include:
expo1=exp(C_ANGLO_0_5*PANGLO_0_5+C_ANGLO_5_10*PANGLO_5_10+C_ANGLO_25_60*PANGLO_25_60+C_ANGLO_60*PANGLO_60+1*(C_ANGLOxFRANCO_0_5*PANGLO_0_5+C_ANGLOxFRANCO_5_10*PANGLO_5_10+C_ANGLOxFRANCO_25_60*PANGLO_25_60+C_ANGLOxFRANCO_60*PANGLO_60)+
C_ALLO_0_1*PALLO_0_1+C_ALLO_1_3*PALLO_1_3+C_ALLO_10*PALLO_10+1*C_ALLOxFRANCO_0_1*PALLO_0_1+C_ALLOxFRANCO_1_3*PALLO_1_3+
C_ALLOxFRANCO_10*PALLO_10+C_POT_0_500*POT_0_500+C_POT_500_2000*POT_500_2000+C_POT_5000_20000*POT_5000_20000+C_POT_20000*POT_20000+
C_POP_0_5000*POP_0_5000+C_POP_5_10000*POP_5_10000+C_POP_25_75000*POP_25_75000+C_POP_75000*POP_75000+C_AUTOROUTE*AUTOROUTE+
C_DISTANCE*DISTANCE+C_RIVE_NORD*RIVE_NORD+C_RIVE_SUD*RIVE_SUD+C_LONGUEUIL*LONGUEUIL+C_LAVAL*LAVAL+C_MONTREAL*MONTREAL);
Because I use an %include statement, I get the "truncated record" WARNING. I read that this happens when there is more than 250 characters et that the solution is to reduce the amount of characters. I guess I could divide this equation in 3 or 4 different, but I wonder if there is any other solution.
Thanks,
Just put in some end of lines. Any where you want that doesn't split a variable name or keyword. How about in front of every + sign?
expo1=exp(C_ANGLO_0_5*PANGLO_0_5
+C_ANGLO_5_10*PANGLO_5_10
+C_ANGLO_25_60*PANGLO_25_60
+C_ANGLO_60*PANGLO_60
+1*(C_ANGLOxFRANCO_0_5*PANGLO_0_5
+C_ANGLOxFRANCO_5_10*PANGLO_5_10
+C_ANGLOxFRANCO_25_60*PANGLO_25_60
+C_ANGLOxFRANCO_60*PANGLO_60)
+C_ALLO_0_1*PALLO_0_1
+C_ALLO_1_3*PALLO_1_3
+C_ALLO_10*PALLO_10
+1*C_ALLOxFRANCO_0_1*PALLO_0_1
+C_ALLOxFRANCO_1_3*PALLO_1_3
+C_ALLOxFRANCO_10*PALLO_10
+C_POT_0_500*POT_0_500
+C_POT_500_2000*POT_500_2000
+C_POT_5000_20000*POT_5000_20000
+C_POT_20000*POT_20000
+C_POP_0_5000*POP_0_5000
+C_POP_5_10000*POP_5_10000
+C_POP_25_75000*POP_25_75000
+C_POP_75000*POP_75000
+C_AUTOROUTE*AUTOROUTE
+C_DISTANCE*DISTANCE
+C_RIVE_NORD*RIVE_NORD
+C_RIVE_SUD*RIVE_SUD
+C_LONGUEUIL*LONGUEUIL
+C_LAVAL*LAVAL
+C_MONTREAL*MONTREAL
);
Just put in some end of lines. Any where you want that doesn't split a variable name or keyword. How about in front of every + sign?
expo1=exp(C_ANGLO_0_5*PANGLO_0_5
+C_ANGLO_5_10*PANGLO_5_10
+C_ANGLO_25_60*PANGLO_25_60
+C_ANGLO_60*PANGLO_60
+1*(C_ANGLOxFRANCO_0_5*PANGLO_0_5
+C_ANGLOxFRANCO_5_10*PANGLO_5_10
+C_ANGLOxFRANCO_25_60*PANGLO_25_60
+C_ANGLOxFRANCO_60*PANGLO_60)
+C_ALLO_0_1*PALLO_0_1
+C_ALLO_1_3*PALLO_1_3
+C_ALLO_10*PALLO_10
+1*C_ALLOxFRANCO_0_1*PALLO_0_1
+C_ALLOxFRANCO_1_3*PALLO_1_3
+C_ALLOxFRANCO_10*PALLO_10
+C_POT_0_500*POT_0_500
+C_POT_500_2000*POT_500_2000
+C_POT_5000_20000*POT_5000_20000
+C_POT_20000*POT_20000
+C_POP_0_5000*POP_0_5000
+C_POP_5_10000*POP_5_10000
+C_POP_25_75000*POP_25_75000
+C_POP_75000*POP_75000
+C_AUTOROUTE*AUTOROUTE
+C_DISTANCE*DISTANCE
+C_RIVE_NORD*RIVE_NORD
+C_RIVE_SUD*RIVE_SUD
+C_LONGUEUIL*LONGUEUIL
+C_LAVAL*LAVAL
+C_MONTREAL*MONTREAL
);
Thanks, it works. That's kind of weird that a so powerfull program like SAS still has bug like this one.
/lrecl=500; after your %include, or however long the line is.
You can also break up the formula into multiple lines without having to split the formula into multiple formula's.
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.