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

Hello guys,

I hope this message finds you well.

I am currently running a "call execute" function through SAS enterprise guide. For whatever reason, when i compile and run the package as a whole i face the following ERROR: THe annoying bit is that if i have to perform a debug exercise, i.e. run all codes one step at a time, i face no issues. I reckon this is some option setting.

 

data _NULL_;

MPRINT(ANALYSEDELIVERYDS): length output_mart_name $50. obs_period $3.;

MPRINT(ANALYSEDELIVERYDS): set defsrcdt24;

403 The SAS System 19:13 Thursday, April 7, 2016

MPRINT(ANALYSEDELIVERYDS): output_mart_name=compress(substr(cats("DQ_24M",substr("APSM",1,8),compress(martgen,"/\-")),1,24));

MPRINT(ANALYSEDELIVERYDS): call execute('%DEFAULTDEF(ds =

WORK.'||compress(output_mart_name)||',output_excluded='||cats(substr(output_mart_name,1,27),"_excl")||', cod_generation

='||compress(defaultgen)||', observation_period = 24, probation_period = 0);');

MPRINT(ANALYSEDELIVERYDS): call symputx(cats('aaa24',_N_),output_mart_name);

NOTE: Line generated by the invoked macro "ANALYSEDELIVERYDS".

10290 compress(_N_)||' as select distinct "aaa24'||compress(_N_)||'" as tmp, "24M" as obs_period, cod_generation as cod_gen,

10290 ! count(1) as counts, sum(default) as totaldef from '||compress(output_mart_ run; data tempdefall12_24; set

 

ERROR 388-185: Expecting an arithmetic operator.

ERROR 76-322: Syntax error, statement will be ignored.

 

I noticed that my proc sql statement execute through "CALL EXECUTE" is truncated - THe truncated section is underlined and made bold in red above. I even referred the complete bit of this code in the code window below (highlighted in red).

 

 

the original code loooks like this:

	data _NULL_;
			length output_mart_name $50. obs_period $3.;
			set defsrcdt24;
			output_mart_name=compress(substr(cats("DQ_24M",substr("&sc.",1,8),compress(martgen,"/\-")),1,24));
			call execute('%DEFAULTDEF(ds = WORK.'||compress(output_mart_name)||',output_excluded='||cats(substr(output_mart_name,1,27),"_excl")||', cod_generation ='||compress(defaultgen)||', observation_period = 24, probation_period = 0);');
			call symputx(cats('aaa24',_N_),output_mart_name);
			call execute('proc sql; create table &workspde..tempdef24'||compress(_N_)||' as select distinct "aaa24'||compress(_N_)||'" as tmp, "24M" as obs_period, cod_generation as cod_gen, count(1) as counts, sum(default) as totaldef from '||compress(output_mart_name)||'; quit;');
		run;

Please do let me know.

 

thanks.

Sebastian

1 ACCEPTED SOLUTION

Accepted Solutions
Loko
Barite | Level 11

Hello,

 

I guess you are running your code thru batch file and you use an %include statement to bring the code to SAS.

In this case you shall increase the length of characters the %include statement reads:

 

 %include "c:\myfiles\mySASsource" / lrecl=500;

 

View solution in original post

4 REPLIES 4
jklaverstijn
Rhodochrosite | Level 12

Possibly your source code gets truncated due to what is described in usage note usage note 4448. Try and break up your lines.

 

Regards,

- Jan.

jklaverstijn
Rhodochrosite | Level 12

Yes literally pasted from the link I gave in my answer. Chosen solution nevertheless.

Loko
Barite | Level 11

Hello,

 

I guess you are running your code thru batch file and you use an %include statement to bring the code to SAS.

In this case you shall increase the length of characters the %include statement reads:

 

 %include "c:\myfiles\mySASsource" / lrecl=500;

 

Loko
Barite | Level 11

@jklaverstijn already answerred 🙂

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 1555 views
  • 5 likes
  • 3 in conversation