DATA Step, Macro, Functions and more

How can we put the big observation in same order with same spaces and lines in the word.

Reply
Contributor
Posts: 27

How can we put the big observation in same order with same spaces and lines in the word.

Hi,

    Can anyone help me out please?

    I have following data set:
    data have;
    id    name country 
   100   abc   ind   


just for understanding clearly, 4th column is comments, I am adding below

comments:
"SWIFTT LIST BRUPI
ACTION REQUIRED: REASSESS ASUP TO PICKUP INCM
Refer to note dated 21/07/2016 entered by TDEMP003.
ACTION TAKEN:  I have reassessed Asupp based on the income from 25/07/2016. Asupp rate is now $69.00 ($34.50 each).
Outcome of call to client No
Letter sent: Yes

Client Number                                                                       12345
Entitlement Date                                                                25/07/2016 

Gross SA                                                             $-  
Gross Wages                                                          $823.31
Extra Income from Assets                                         $-  
TOTAL GROSS INCOME                                               $823.31


so there are 4 columns.

i want the result in word like this;

             id       100
       name       abc
    country        ind

comments    "SWIFTT LIST BRUPI
                     ACTION REQUIRED: REASSESS ASUP TO PICKUP INCM
                    Refer to note dated 21/07/2016 entered by TDEMP003.
                   ACTION TAKEN:  I have reassessed Asupp based on the income 
                   25/07/2016. Asupp rate is now $69.00 ($34.50 each).
                   Outcome of call to client No

                    Letter sent: Yes

 


                  Client number 12345

                   Entitlement
                    Date 25/07/2016                                                    

               Gross SA                                                            
              Gross Wages                                                             $823.31
              Extra Income from Assets                                            $-  
             TOTAL GROSS INCOME                                            $823.31

 

I tried with following code:

data null; set client_details;

    file " &WORK_DIR_PATH/&filename..doc" noprint lrecl=1200 print;
           put 'ID' @ 30 id /;
           put 'Client name' @30 Name /;
           put 'country' @30 country /;
           put 'comments' @30 comments ;

; run;

I am looking here for 'comments' field (4th column). i could not arrange them in order exactly that shows in the field. my reuslts are looking ugly. I mean the words and numbers are not showing in same order as in the table. so can anyone please tell how to write that big observation into multiple lines or exctly how it is showing the row.

 

Trusted Advisor
Posts: 1,569

Re: How can we put the big observation in same order with same spaces and lines in the word.

Posted in reply to ramchinna24

How do you mannage the comment parts? What delimiters are used to seperate the inner lines of the comment ?

Is it possible to split te comment to its part?

 

What is your code to print the output doc file ? 

Maybe sum changes to your code will do your request.

Ask a Question
Discussion stats
  • 1 reply
  • 148 views
  • 0 likes
  • 2 in conversation