BookmarkSubscribeRSS Feed
BSL
Calcite | Level 5 BSL
Calcite | Level 5

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

5 REPLIES 5
Reeza
Super User

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.

BSL
Calcite | Level 5 BSL
Calcite | Level 5

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

Reeza
Super User

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

ballardw
Super User

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.

Patrick
Opal | Level 21

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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