Write and run SAS programs in your web browser

How to move a binary file using SAS studio 9.4

Reply
New Contributor
Posts: 3

How to move a binary file using SAS studio 9.4

Need to move the binary file output for scoring from HPForest from one location to another. I am able to move codes using the statement but the binary file is somehow getting corrupted.
Super User
Super User
Posts: 7,565

Re: How to move a binary file using SAS studio 9.4

You haven't really given any information in this post.  At a guess I would say that if your transfering a binary file you would likely need to use (s)FTP, and set the option to binary.  However as I have no information its hard to say.  Corruption could mean any number of things, moving OS's for instance, bit version of the system, even the app used to open it.

New Contributor
Posts: 3

Re: How to move a binary file using SAS studio 9.4

Apologies for that. I am writing a binary file using proc hpforest to generate the model scoring code and then using SAS 9.4, i have to move it to a different path. I was trying to move it using file and infile statement but it is corrupting the binary file as I am not able to use the file for scoring using proc hp4score. Let me know incase you will need any further information.
Super User
Super User
Posts: 7,565

Re: How to move a binary file using SAS studio 9.4

Ah, then you need to put recfm=n on the infile, etc:

data _null_;  
  infile "..." recfm=n;
  file "..." recfm=n;
  input; 
  put _infile_;
run;

Although, you could just copy the file using OS commands if you have X command enabled.  

New Contributor
Posts: 3

Re: How to move a binary file using SAS studio 9.4

The x command is not enabled. I tried the recfm=n option, it says the _infile_ input/put statement is inconsistent with binary mode I/O. The execution of the data step is being terminated.
Ask a Question
Discussion stats
  • 4 replies
  • 117 views
  • 0 likes
  • 2 in conversation