use of ( ) in the following code

Reply
Contributor BSL
Contributor
Posts: 25

use of ( ) in the following code

hi,

I am not able to understand the use of parenthesis ( ) in the following code can any explain it to me.

data temp ( );

  set table1 ( ) table2 ( ) table3 ( );

run;

-rahul

Attachment
Grand Advisor
Posts: 17,420

Re: use of ( ) in the following code

In your example they serve no purpose.

Most likely the code was designed to accommodate various options that may need to be included in the brackets via macro variables. If no options are present it would resolve as in your code.

Contributor BSL
Contributor
Posts: 25

Re: use of ( ) in the following code

please see the attached original code where I found these parenthesis used at the bottom.

Grand Advisor
Posts: 17,420

Re: use of ( ) in the following code

Sorry, I can't access attachments. Consider including full code here or someone else will answer.

Grand Advisor
Posts: 10,235

Re: use of ( ) in the following code

The actual code in the attachment is

data LASRLIB.iFinIncomeStatement (  );

set TEMP_LASR_VIEW_6296 (  ) TEMP_LASR_VIEW_6696 (  ) interimTable();

run;

I suspect someone previously just had () for data set  options for testing the code, just as to pull in just one record.

Respected Advisor
Posts: 3,837

Re: use of ( ) in the following code

These brackets have no function if empty. I was actually not even sure if it's valid SAS syntax but I could execute such code without any issues.

data temp (keep=var1 var2 );

  set table1 ( ) table2 ( ) table3 ( );

run;

Ask a Question
Discussion stats
  • 5 replies
  • 250 views
  • 0 likes
  • 4 in conversation