BookmarkSubscribeRSS Feed
moxsh
Fluorite | Level 6

Hi All,

I am trying to run a query from the database where I am specifying some accounts, However the accounts I want to specify in the where clause are more than 30,000 so I get the error message

"Submitted code lines  longer than 6,000 characters,SAS is unable to process lines longer than 6,000 characters" Is there any way around this?

7 REPLIES 7
Tom
Super User Tom
Super User

Are the account names really over 6000 characters long?

If not try inserted some line breaks into your program file so that the lines are not so long.

If you expect an actual human to be able to read and understand the file limit the length of the lines to 80 characters or less.  

moxsh
Fluorite | Level 6
Its a list of many accounts,so on the SAS Editor they exceed 6,000 characters by far
Ksharp
Super User

As Tom said :

 

If not try inserted some line breaks into your program file so that the lines are not so long.

ballardw
Super User

Are you going to admit that perhaps you created a macro variable to do this?

I may be easier, and certainly won't have that character limit by using a JOIN on a data set that contains the account numbers.

Generic example:

Proc sql;
   create table want as 
   select b.* 
   from accountstokeep as a
           left join
           otherdataset as b
          on a.accountnumber=b.accountnumber
  ;
quit;
moxsh
Fluorite | Level 6
I tried this but it still writes accounts that dont have anything to return on the "want" dataset which sorts of takes some time to execute
LinusH
Tourmaline | Level 20

Then change to inner join instead.

Will probably perform better as well.

Data never sleeps
andreas_lds
Jade | Level 19

@moxsh wrote:

Hi All,

I am trying to run a query from the database where I am specifying some accounts, However the accounts I want to specify in the where clause are more than 30,000 so I get the error message

"Submitted code lines  longer than 6,000 characters,SAS is unable to process lines longer than 6,000 characters" Is there any way around this?


Looks like something went wrong in the design-phase. Those accounts should be in a dataset, so that you could use a join to get the required output. See first answer by @ballardw 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1279 views
  • 4 likes
  • 6 in conversation