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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1723 views
  • 0 likes
  • 3 in conversation