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

Hello ;

My problem is that the data string that I would like to put into a cell in excel is getting truncated.

I have tried breaking the string up and using macro variables.

But the complete string does not show up in the cell in excel,.

The max length that I can generate is around 162 characters.

I am sure that I am over looking something, but I am not sure what.

Thank you for your help.

options mprint mlogic symbolgen msglevel=i orientation = landscape

            nonumber nodate nofmterr ls=max lrecl=max ;

This code goes to the proc report.

Bring in the data etc.

if name = "&name1  " then do ; col3 = "&length1  " ; col4 = "&formatB1  "; col5 = "&CTerm1"  ; end ;

if col6 = "Long text sting goes here" : end ;

ods tagsets.EXcelXP options (sheet_name="&dsnme"
                         frozen_headers='1'
                         autofit_height = 'yes')
  file= "c:\sriprojects\&prjname\define_output\&dsnme..xml"
  style=minimal ;
            


proc report data = &dsnme.E headline headskip  split='|' missing
                  style(header)=[backgroundcolor=white  ];
   column  name label TypeC col3 col4 col5 col6 col7 col8 varnum  ;
define varnum / order=data noprint ;
define name   / display 'Variable Name'      format= $20.   STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];  
define label  / display 'Variable Label'     format= $60.   STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];  
define typeC  / display 'Type'               format= $10.   STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];
define col3   / display 'Length'             format= $10.   STYLE(column)=[cellwidth=100 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];  
define col4   / display 'Format '            format= $100.  STYLE(column)=[cellwidth=100 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];
define col5   / display 'Controlled Terms '  format= $100.  STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];  
define col6   / display 'Origin'             format= $100.  STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ]; 
define col7   / display 'Role'               format= $100.  STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];
define col8   / display 'Comments'           format= $100.  STYLE(column)=[cellwidth=175 just=left vjust=top] style(header)=[font_weight=bold just=left vjust=top ];  

run ;

ods tagsets.EXcelXP close;
ods listing ;

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

What happens if you remove those FORMAT= opions on the define statements?

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  I can put huge blocks of text into a cell using PROC REPORT. There have been previous postings in the forum about this.

One thing I'd recommend is getting rid of your FORMAT= option, which can cause truncation.

cynthia

data_null__
Jade | Level 19

What happens if you remove those FORMAT= opions on the define statements?

JGS
Calcite | Level 5 JGS
Calcite | Level 5

Thank you.

That seems to be the issue.

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
  • 3 replies
  • 1562 views
  • 3 likes
  • 3 in conversation