Help using Base SAS procedures

How to present text block in Excel using Proc

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

How to present text block in Excel using Proc

I have to present this information in excel.

 

Collection Agent The collection agents contracted to the Dept are Humanity Corporation Pty Ltd. The role of these agents is to recover debts on behalf of the Dept
   
Customer An individual, group or organisation who has been allocated a   Number
   
Customer Payment Customer payments include the following repayment methods: Credit Card Payments, Cash Payments, Cheque Payments, PayPal Payments, EFT Payments, Money Ord Payments or Deductions from the customer's bank account.
   
Debt An overpayment of a customer’s entitlement that is legally recoverable plus any additional charges.

info.JPG

Accepted Solutions
Solution
‎06-12-2016 11:26 PM
Super User
Super User
Posts: 7,413

Re: How to present text block in Excel using Proc

I have started with this, but need to go in a meeting now - you need to add in the Excel code to move bold text to center of cell.

data have;
  length col1 col2 $2000;
  infile datalines dlm="~";
  input col1 $ col2 $;
datalines;
Collection Agent~The collection agents contracted to the Dept are Humanity Corporation Pty Ltd. The role of these agents is to recover debts on behalf of the Dept
Customer~An individual, group or organisation who has been allocated a   Number
Customer Payment~Customer payments include the following repayment methods: Credit Card Payments, Cash Payments, Cheque Payments, PayPal Payments, EFT Payments, Money Ord Payments or Deductions from the customers bank account.
Debt~An overpayment of a customer’s entitlement that is legally recoverable plus any additional charges.
;
run;

ods tagsets.excelxp file="c:\test.xml";
proc report data=have nowd;
  columns _all_;
  define col1 / " " order order=data style={cellwidth=5cm just=l font_weight=bold};
  define col2 / " " style={cellwidth=10cm just=l};
  compute before col1;
    line '';
  endcomp;  
run;
ods tagsets.excelxp close;

View solution in original post


All Replies
Super User
Posts: 17,912

Re: How to present text block in Excel using Proc

Place the data into a dataset, including blank lines, and use proc print to display it.

You can use either ODS Excel or Tagsets.ExcelXP or Proc Export.

 

 

Super User
Super User
Posts: 7,413

Re: How to present text block in Excel using Proc

Sorry, what is the question?

Occasional Contributor
Posts: 13

Re: How to present text block in Excel using Proc

I present a summary report on one sheet and on the other sheet I need to present the information which is attached with the post.
Issue I am having is the way text is needs to presented.
Super User
Posts: 17,912

Re: How to present text block in Excel using Proc

You need to be more specific please. 

 

What is causing the issue? Have you tried the method suggested - creating a dataset and exporting?

 

How are you creating file currently?

Solution
‎06-12-2016 11:26 PM
Super User
Super User
Posts: 7,413

Re: How to present text block in Excel using Proc

I have started with this, but need to go in a meeting now - you need to add in the Excel code to move bold text to center of cell.

data have;
  length col1 col2 $2000;
  infile datalines dlm="~";
  input col1 $ col2 $;
datalines;
Collection Agent~The collection agents contracted to the Dept are Humanity Corporation Pty Ltd. The role of these agents is to recover debts on behalf of the Dept
Customer~An individual, group or organisation who has been allocated a   Number
Customer Payment~Customer payments include the following repayment methods: Credit Card Payments, Cash Payments, Cheque Payments, PayPal Payments, EFT Payments, Money Ord Payments or Deductions from the customers bank account.
Debt~An overpayment of a customer’s entitlement that is legally recoverable plus any additional charges.
;
run;

ods tagsets.excelxp file="c:\test.xml";
proc report data=have nowd;
  columns _all_;
  define col1 / " " order order=data style={cellwidth=5cm just=l font_weight=bold};
  define col2 / " " style={cellwidth=10cm just=l};
  compute before col1;
    line '';
  endcomp;  
run;
ods tagsets.excelxp close;
Occasional Contributor
Posts: 13

Re: How to present text block in Excel using Proc

Thanks !!!

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 231 views
  • 0 likes
  • 3 in conversation