Desktop productivity for business analysts and programmers

call execute error

Accepted Solution Solved
Reply
Contributor
Posts: 44
Accepted Solution

call execute error

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


Accepted Solutions
Solution
‎04-08-2016 07:45 AM
Super Contributor
Posts: 319

Re: call execute error

Posted in reply to sebster24

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


All Replies
Valued Guide
Posts: 530

Re: call execute error

Posted in reply to sebster24

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.

Valued Guide
Posts: 530

Re: call execute error

Posted in reply to jklaverstijn

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

Solution
‎04-08-2016 07:45 AM
Super Contributor
Posts: 319

Re: call execute error

Posted in reply to sebster24

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;

 

Super Contributor
Posts: 319

Re: call execute error

@jklaverstijn already answerred Smiley Happy

🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 483 views
  • 5 likes
  • 3 in conversation