DATA Step, Macro, Functions and more

Truncated record

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 110
Accepted Solution

Truncated record

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,


Accepted Solutions
Solution
‎04-07-2013 06:53 PM
Super User
Super User
Posts: 6,500

Re: Truncated record

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

);

View solution in original post


All Replies
Solution
‎04-07-2013 06:53 PM
Super User
Super User
Posts: 6,500

Re: Truncated record

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

);

Frequent Contributor
Posts: 110

Re: Truncated record

Thanks, it works. That's kind of weird that a so powerfull program like SAS still has bug like this one.

Super User
Posts: 17,824

Re: Truncated record

/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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 515 views
  • 3 likes
  • 3 in conversation