Displaying the sas dataset when right clicked and viewed in Excel

Reply
Contributor
Posts: 62

Displaying the sas dataset when right clicked and viewed in Excel

Hi,

I have a dataset with variable value containing Message information. When I read the Message from the text document I am appending the values from different observations and the complete text is comming in one line.

Is there any option in sas to display the message variable in (as in Excel we use alt + enter) more than one line as in header with split option.

The requirement is the data should be only in one variable and when right clicked should be able to view in excel in userfriendly format.

Please find the example below.

Input text document::::

x         y       z       Message: This is a sample message,

                             where I have to read the information in

                             one single variable in sas data set.

When I read this dataset the variable message comes in one line. say like the below

Message Variable

Message: This is a sample message, where I have to read the information in one single variable in sas data set.

But the issue here is to split the dataset value or set the column width or set the height of the variable value for display purpose or when

viewed by client in excel.

I have used byte(10) and concatenated the observations but does not work.

Thanks in advance.

Contributor
Posts: 62

Re: Displaying the sas dataset when right clicked and viewed in Excel

Guys can any one please help in the above problem.  Please state wether it is possible or not.

Even if I have to export to Excel the solution will be helpful (alt + enter ) format.

Thanks in advance.

Super Contributor
Posts: 644

Re: Displaying the sas dataset when right clicked and viewed in Excel

This is a question about how long data items in a SAS dataset can be displayed in multiple lines.  It is not a question of how the data is stored 'under the covers' because it makes no sense in that context, either for SAS or Excel.

I doubt whether you can make the SAS data viewer behave in the way you describe but Proc report (and tabulate) can wrap data within fixed width cells.  An example from the SAS documentation:

proc format ;

   value questionf

   1='This is an example of a description that is too long so it wraps down to the next line';

run;

  

data a;

   input question rater $ avg;

   datalines;

1 manager 3

1 staff 2

1 peer 3

;

run;

  

ods listing close;

ods escapechar='^';

options nodate nonumber orientation=portrait;

proc report data=a nowd spanrows;

   column question rater avg;

   define question / order

                     format=questionf.

                     style(column)={cellwidth=2.2in};

   define rater / display;

   define avg   / display;

run;

(this comes from 9.2 documentation that describes an undesired side effect with ODS PDF:

45549 - Wrapped text strings in the first column cause unwanted white space in subsequent rows in PR...)


Richard

Contributor
Posts: 62

Re: Displaying the sas dataset when right clicked and viewed in Excel

Posted in reply to RichardinOz

Thanks Richard

your comment is helpful in finalizing my decission..

As I can clearly specify to my client that dataset cannot be viewed directly in desired format, I can give a desired output if needed (ODS, EXCEL, HTML...).

Thanks again.

Ask a Question
Discussion stats
  • 3 replies
  • 247 views
  • 3 likes
  • 2 in conversation