BookmarkSubscribeRSS Feed
tekish
Quartz | Level 8

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;

 

 

3 REPLIES 3
Reeza
Super User

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;

 

 


 

ChrisNZ
Tourmaline | Level 20

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]

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 871 views
  • 0 likes
  • 3 in conversation