BookmarkSubscribeRSS Feed
fengyuwuzu
Pyrite | Level 9

In the picture below, we have some long terms and want to indent them as indicated by the red mark. 

Any idea how to do it in SAS? 

One idea is to generate a new variable, adding some split characters within the long term based on the width of the column. 

 

Capture.PNG

2 REPLIES 2
ballardw
Super User

First, where is this? In a data set or report output? If report output which procedure? If this is not going to an ODS destination such as HTML, RTF or PDF you may have a lot of work cutout. You might be able in a report procedure to force what looks like an indent with

a style PADDINGLEFT option. See this brief example using proc print output.

data junk;
   infile datalines dlm='|' truncover;
   length longline $100.;
   input longline value ;
datalines;
   This is a longish line that starts with some spaces.| 124
   As does this line also. Note that I have no special character in the data.|456
This line does not have any leading spaces which are removed by report procedures.| 678
;
run;

proc print data=junk noobs;
   title "Default print";
   var longline /style=[width=1.5in];
   var value;
run;title;

proc print data=junk noobs;
   title "Style option Paddingleft added";
   var longline / style=[width=1.5in paddingleft=.1in ];
   var value;
run;title;

 

 

Is there a specific rule involved that the lines starting with "non-compliance" "regulation" "source" or "match" are not indicated?

 

It appears as though "Missing or out of Window" "Entered study but subject did not satisfy entry criteria" "Other"  are actually group headers and not variable values. Is that actually the case.

 

BTW PICTURES are the only data interchange form worse than spreadsheet files. At least we can copy and paste an paste from spreadsheets (if we are willing to open them).

fengyuwuzu
Pyrite | Level 9

Thank you Ballardw.

 

I cut from a table, a PDF file produced from proc report. I will look at the option PADDINGLEFT.

 

 

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
  • 2 replies
  • 850 views
  • 0 likes
  • 2 in conversation