BookmarkSubscribeRSS Feed
SanjayM
Calcite | Level 5
Can we wrap a columns text in a List data. The output of List data is text
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:

Behind the scenes of the LIST Data task is PROC PRINT. If you create a TXT file (Listing Destination output), using LIST Data task (PROC PRINT), then you cannot wrap text. If you create a TXT file (Listing Destination output), using PROC REPORT code, then you can wrap text.

See Example 1 program in this forum posting for an example of PROC REPORT code vs using a format in PROC PRINT:
http://support.sas.com/forums/thread.jspa?messageID=7408ᳰ

If you switch over to the world of ODS (and use ODS RTF, ODS PDF or ODS HTML), you CAN wrap text for those destinations' output files by using the CELLWIDTH style attribute. The CELLWIDTH technique will even work for PROC PRINT -- but ONLY with those 3 destinations (NOT LISTING Destination, therefore, not TXT).

The bottom line is that if you are using the List Data task and sending your output to the LISTING destination (TXT file), then there is no way to force wrapping. You can use the FLOW and WIDTH options with PROC REPORT -- but this only works for LISTING.

Perhaps this table will convey the information better. PRINT and List Data Task are the same thing in this table. LISTING destination and TXT file are the same thing:
[pre]
PROC DESTINATION TECHNIQUE WORK
---------------- ---------------- ------------- ----
PRINT/LIST Data Listing(TXT) change format NO
REPORT Listing(TXT) FLOW/WIDTH YES
REPORT ODS destination FLOW/WIDTH NO
REPORT/PRINT ODS HTML CELLWIDTH YES
REPORT/PRINT ODS RTF CELLWIDTH YES
REPORT/PRINT ODS PDF CELLWIDTH YES
REPORT/PRINT Listing(TXT) CELLWIDTH NO
[/pre]

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 1556 views
  • 0 likes
  • 2 in conversation