Experts,
I have a data stored as binary in the server and I want to convert the banary data into PDF format. Is there a way to convert banary data into a report in PDF format.
data binarydata;
infile "C:\bin\binarydata.txt" recfm=N;
input c $char1.;
put c $char1. @@;
run;
ods pdf file="C:\bin\binarydata.pdf";
proc print data=binarydata;
run;
ods pdf;
Your approach seems correct. Which part isn't working or what isn't working as expected (Note that I'm not going to import a binary file that I don't understand).
Post any errors from the log.
@tekish wrote:
Experts,
I have a data stored as binary in the server and I want to convert the banary data into PDF format. Is there a way to convert banary data into a report in PDF format.
data binarydata;
infile "C:\bin\binarydata.txt" recfm=N;
input c $char1.;
put c $char1. @@;
run;ods pdf file="C:\bin\binarydata.pdf";
proc print data=binarydata;
run;
ods pdf;
Your data looks like hexadecimal codes, not binary data.
So something like this is more suitable.
data binarydata;
infile "&pathin/binarydata.txt" recfm=N;
file "&pathout/binarydata.pdf" recfm=N;
input C $hex2. @@;
put C $char1. @@;
putlog C $char1. @@;
run;
This should work as this code yields an output file that starts with:
Catalog/ViewerPreferences<</Direction/L2R>>>>endobj2 0 obj<</Count 1/Kids[ 4 0 R ]/Type/Pages>>
[Edited: Sorry, altered for clarity]
Fixed typo in title.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.