04-09-2015 01:52 AM
By looking at the file specification, I would advise to look for an alternative way rather then trying to import it using something like INFILE.
What system/SW produced the file?
Perhaps they offer an API, like a JDBC driver.
04-09-2015 11:01 AM
There is an export tool in the HDF5 application that will output csv files. And R has a package that reads HDF5. But we still use SAS for data management and I was hoping to avoid the intermediary steps. Jaap is right, though, I could use XCMD to call a Python or R routine. Thank you for your help.
04-09-2015 05:58 PM
Yup, I believe that is the program R calls as part of the R package rhdf5. The solution I've settled on is calling the h5dump function in R (which in turn calls the h5dump tool you linked to, I think) from Proc IML. The bit64 package is also used because, at least in my case as I'm running 32-bit SAS 9.4, integer64 data types are created in R from the HDF5 files. SAS does not recognize the integer64 data type on SAS 9.4 32-bit, maybe 64-bit would work. Since I am getting integer counts from instruments, I was able to safely convert the integer64 data to regular integers before importing into SAS. Anyway, here is the code I've used and it appears to work.
submit / R;
x <- h5dump("c:\\data\\Counts.h5",bit64conversion='bit64')
s <- do.call(cbind,x$Hist)
ss <- as.integer.integer64(s)
*** Create data set work1 from the IML matrix ss. ***;
create work1 from ss;
append from ss;