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

Hi Team,

I was trying to use ODS tagsets so that Formats apply accordingly. Otherwise with just the Export to Excel formats were not getting applied in the sheet.

I thought I could Just use:

ods tagsets.excelxp file="C:drive\colect121011001(2)\colect.xml";

data final;

set procedures_descrip2;

run;

ods tagsets.excelxp close;

BUT ONLY AFTER USING THE BELOW CODE I GET THE RESULT.

ods listing close;

ods tagsets.excelxp file="C:\Data\Projects\Colectomy-20121011001(2)\colectomy.xml";

data final;

set procedures_descrip2;

file print ods;

put _ods_;

run;

ods tagsets.excelxp close;

ods listing;

My Question is why do we have to use statements???

ods listing

file print ods

put _ods_

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

ODS basically handles print output. A data step by itself doesn't create any output unless you use one of the options to create "print" data. The FILE PRINT ODS; statement says "if this data step creates any print type output, direct it to the ODS handler". The PUT _ODS_; says to create the print type output.

The ODS listing is to reopen the output destination after you had closed it with the ODS LISTING CLOSE; statement.

Without that your next output attempt would like generate a "No output destinations are open" error. It is only needed if you have closed the listing destination, i.e. the output window in 9.2 and earlier.

View solution in original post

2 REPLIES 2
ballardw
Super User

ODS basically handles print output. A data step by itself doesn't create any output unless you use one of the options to create "print" data. The FILE PRINT ODS; statement says "if this data step creates any print type output, direct it to the ODS handler". The PUT _ODS_; says to create the print type output.

The ODS listing is to reopen the output destination after you had closed it with the ODS LISTING CLOSE; statement.

Without that your next output attempt would like generate a "No output destinations are open" error. It is only needed if you have closed the listing destination, i.e. the output window in 9.2 and earlier.

robertrao
Quartz | Level 8

Hi,

Thanks a lot for the detailed information.

Regards

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 832 views
  • 0 likes
  • 2 in conversation