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]

 

hackathon24-white-horiz.png

Join the 2025 SAS Hackathon!

Calling all data scientists and open-source enthusiasts! Want to solve real problems that impact your company or the world? Register to hack by August 31st!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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