The SAS Output Delivery System and reporting techniques

Printing SAS data in Paragraph format

Reply
N/A
Posts: 0

Printing SAS data in Paragraph format

Hi,

I have a sas data as below
Name Age Coll
Mohan 25 Anna
xxxxx 33 xxxxx
vnsjdn 56 DNSKN

I want the above data to be printed in below format

Name: Mohan
Age : 25
Coll: Anna

Name:xxxxx
Age:33
Coll:xxxxx

Name:
Age:
Coll:

Could any one please help me to get this accomplished?
Valued Guide
Posts: 2,177

Re: Printing SAS data in Paragraph format

Posted in reply to deleted_user
proc forms
or[pre]data _null_ ;
file 'your output.file.txt' ;
set your_data;
put 'name :' +1 name / 'age :' +1 age / 'Coll :' +1 coll ;
run ;[/pre]It could be simpler if you accept '=' instead of ' : ' [pre]data _null_ ;
file 'your.equal.file.txt' ;
set your_data ;
put (name age coll) (/=) ; * <-- > / for newline =for "named output " ;
run ;[/pre]
peterC
Ask a Question
Discussion stats
  • 1 reply
  • 115 views
  • 0 likes
  • 2 in conversation