SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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