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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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