DATA Step, Macro, Functions and more

ODS TAGSETS

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

ODS TAGSETS

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


Accepted Solutions
Solution
‎10-26-2012 05:03 PM
Super User
Posts: 10,500

Re: ODS TAGSETS

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


All Replies
Solution
‎10-26-2012 05:03 PM
Super User
Posts: 10,500

Re: ODS TAGSETS

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.

Super Contributor
Posts: 1,040

Re: ODS TAGSETS

Hi,

Thanks a lot for the detailed information.

Regards

☑ This topic is SOLVED.

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

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