BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
vnreddy
Quartz | Level 8

 

Hi,

Could someone help me with the position of the .txt columns output

This is how my current .txt output file is produced:

vnreddy_0-1666796029803.png

As you can see order date starting @7 and ending at @17 position, but i want it be moved one position right: i.e., order date starting at 8 and ending at 18.

 

I have used below code, could someone help me with it:

 

 

ods listing file = "&sas_drv.:/SASFILES/Daily.txt";
ods escapechar='^';

options nodate nonumber  orientation=landscape ps=max;
proc report data=throughput_final nowd split='~' noheader headskip ls=142;
   column order_date order_code product_code qty delivery_method;
   define order_date/display "Date" spacing=2; 
   define 'order_code'n/display "Order_code" left spacing=2;
   define product_code/display "Product Code" left spacing=2;
   define qty/analysis "Qty" spacing=2;
   define delivery_method/display "Delivery Method" spacing=2;
   run;

 Thanks

vnreddy

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

There is nothing in that code that is saying to start the first column at the 7th character on the line.

Probably you are seeing the output in the 7th column because you are using the CENTER option and it happens to be that 6 spaces is then number that centers that report on the line for the given value of LINESIZE option you have set.

 

You could play with the LINESIZE option of the width of the report.

 

But why not just turn off the centering?  Either change the system option or add the NOCENTER option to the PROC REPORT statement.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

There is nothing in that code that is saying to start the first column at the 7th character on the line.

Probably you are seeing the output in the 7th column because you are using the CENTER option and it happens to be that 6 spaces is then number that centers that report on the line for the given value of LINESIZE option you have set.

 

You could play with the LINESIZE option of the width of the report.

 

But why not just turn off the centering?  Either change the system option or add the NOCENTER option to the PROC REPORT statement.

vnreddy
Quartz | Level 8

Hi,

nocenter and spacing solved the issue. Thank you for the help

 

ods listing file = "&sas_drv.:/SASFILES/Daily.txt";
ods escapechar='^';

options nodate nonumber nocenter orientation=landscape ps=max;
proc report data=throughput_final nowd split='~' noheader headskip ls=142;
   column order_date order_code product_code qty delivery_method;
   define order_date/display "Date" spacing=7; 
   define 'order_code'n/display "Order_code" left spacing=2;
   define product_code/display "Product Code" left spacing=2;
   define qty/analysis "Qty" spacing=2;
   define delivery_method/display "Delivery Method" spacing=2;
   run;
Reeza
Super User
Would a data step make more sense here than proc report? Easier to control positions and seems like you want a fixed layout file as well. As long as it's just printing information that seems an easier method IMO.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1073 views
  • 4 likes
  • 3 in conversation