06-03-2015 10:24 AM
I recently started working on SAS and currently i am on a data migration project wherein I am required to find the catalog files (sas7bcat) in various folders and convert them into .xpt files. I have approximately 500 catalog files in the network drive which I need to convert into .xpt files. Once I do that I need to convert them back to .sas7bcat format in linux server.
I am learning proc cport and cimport but I am unable to understand how exactly is the code utilized and how do I use to convert a large number of files at a time.
Can anyone please guide me as to what approach I need to take and any sample codes that I can follow to achieve the goal.
06-03-2015 10:49 AM
Are your catalogs in a single library or multiple libraries? For each library:
filename tranfile 'transport-file'; /* obviously use a different file name for each library*/
proc cport library=sourcelibrary file=tranfile memtype=catalog;
06-04-2015 05:26 PM
Thanks a lot Ballard. That really helped. I could create transport files.
I encountered an unexpected error though. I got the following error while generating .xpt files form catalog files in a particular network drive:
ERROR: File SOURCE.FORMATS.CATALOG was created for a different operating system.
I researched on it and found out that this occurs because the format was generated in probably a 32 bit operating system. I am currently using 64 bit operating system.
I am not able to get around this issue. I tried using the option- options nofmterr; before running the code for generating the .xpt file but SAS still doesn't read the catalog.
Is there a way I can work on it or is it necessary to return to the source operating system and generate the transport file?
06-05-2015 03:32 AM
The error message indicates that the format(s) would not have worked in your current environment at all (any use would have caused the ERROR message you got); I think it is safe to consider the catalog as legacy that can be discarded.
If you find you absolutely need the contents and can't recreate the original environment (for which you need the OS, SAS version & valid license), inspecting the catalog with a hex tool might be helpful as a last resort.
06-08-2015 03:07 PM
I have multiple catalog files scattered in various folders in a network drive. Currently I am using a code that generates a single transport file at a time. I was wondering if there is a way to point out the paths to SAS so that it can generate all the transport files at one time in the same folder where the catalog file is located or do I need to manually create the transport files for each catalog.
06-08-2015 03:20 PM
You should be able to create a library that points to multiple locations. Then when using that library for the cport code you'd get them all.
libname port ("c:\project1\datafolder" "e:\project2\datafolder");
and then use the PORT library.
I don't know if there is any way to segregate them out with cimport on the other end though.
06-04-2015 06:23 PM
cport cimport are tools for upgrading all data to a similar bitness system. To have full functionality SAS/Share or SAS/connect is needed.
38339 - SAS® file compatibility when upgrading from 32-bit to 64-bit Microsoft Windows This seems to get working (one direction) at Windows
For Unix it is different as it notes the requirement of SAS/Connect or SAS/SHare
06-04-2015 07:33 PM
If the FORMAT catalog you are trying to export from Windows 64-bit SAS is 32-bit then it would not be usable under Windows 64-bit SAS so there would be no point exporting it anyway.
Do you have access to say Windows 32-bit SAS on a desktop somewhere to be able to test the catalog out?