DATA Step, Macro, Functions and more

Converting 9.4 32 bit datasets into 9.4 64 bit datasets

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 128
Accepted Solution

Converting 9.4 32 bit datasets into 9.4 64 bit datasets

[ Edited ]

Hi,

 

I need to convert some datasets that were created in 32 bit SAS into 64 bit sas (both 9.4).  I found proc migrate, but no example i've found lists datasets.

 

I found:
libname in "path";

libname out base "path"

proc migrate in=in out=out; run;

 

The datasets i have to convert exist in a library with 100s of other datasets.  I can't migrate the entire library.

 

Does anyone know how to convert just 5 of the datasets?  Where to list them? I'm not seeing any examples of code with a leading key word like "var" in proc print or "tables" in proc freq or "delete or change" in proc datasets.

 

 

 

Thanks
Megan

 

EDIT: Solved.  Thanks guys!


Accepted Solutions
Solution
‎06-26-2017 10:46 AM
Super User
Super User
Posts: 7,071

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

For such a simple issue no need to use PROC MIGRATE.  You should be able to do it using PROC COPY.

If you are running the conversion using the target 64bit version of SAS then just make a new library and copy the files.

libname old 'directory with 32bit files';
libname new 'directory for 64bit files';
proc copy inlib=old outlib=new datecopy noclone ;
run;

Otherwise use the OUTREP= option to tell SAS what format to create.

https://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#n0p1yuyzltd52...

 

View solution in original post


All Replies
SAS Employee
Posts: 124

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

Hi @MeganE

 

The CPORT/CIMPORT procedures might be what you're looking for.

With the CPORT proc, you can select your SAS Files, furtehr details are available here http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p0v36fq2v53pv8n1042qy...

 

Hope that helps.

 

Cheers,
Damo

Super User
Posts: 7,832

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

Move the datasets in question to a new library, run proc migrate there, and copy back.

AFAIK, 32-bit datasets should be readable anyway, they just use CEDA. So you could simply rename the datasets first, then use a data step to recreate them as 64-bit, then remove the renamed dataset.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 128

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

Posted in reply to KurtBremser

Thanks. While copying them over and then trying this is an option, they're quite large, one is 60gb.  14gb, 16 gb, etc.

Super User
Posts: 7,832

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

If you can read them (what I suppose), rename them with proc datasets and then do a simple

data whatever;
set _whatever;
run;

and then remove the renamed instances.

proc migrate will also do a complete read/write, so the overall load should be the same.

Don't forget to add the compress=yes option if the datasets are already compressed. If they are not yet compressed, consider using the option. You might save lots of disk space.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 128

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

Posted in reply to KurtBremser

But what is the proc migrate code.  So far, through all of my googling and asking, all i can find on proc migrate is converting an entire libarary.  As like i said in my original post, i can't migrate the entire library.  There are 100s of datasets in there and i just need to migrate 5.  How do you list the datasets out?  I can't find that part anywhere.

Super User
Posts: 7,832

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

So you don't know yet which ones need to be converted?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Employee
Posts: 124

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

Posted in reply to KurtBremser

Hi @MeganE

 

The documentation for the MIGRATE procedure states "Migrates a SAS library forward to the current release of SAS.", you can't select individual datasets.

Not sure if it's the best option but the CPORT proc will let you select datasets you want to migrate.

Then the CIMPORT will read the transport file, for instance

 

filename test "c:\temp\test.cpo";
proc cport lib=sashelp file=test;
select cars class;
run;

proc cimport infile=test library=work;
run;

Cheers,
Damo

Solution
‎06-26-2017 10:46 AM
Super User
Super User
Posts: 7,071

Re: Converting 9.4 32 bit datasets into 9.4 64 bit datasets

For such a simple issue no need to use PROC MIGRATE.  You should be able to do it using PROC COPY.

If you are running the conversion using the target 64bit version of SAS then just make a new library and copy the files.

libname old 'directory with 32bit files';
libname new 'directory for 64bit files';
proc copy inlib=old outlib=new datecopy noclone ;
run;

Otherwise use the OUTREP= option to tell SAS what format to create.

https://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#n0p1yuyzltd52...

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 180 views
  • 0 likes
  • 4 in conversation