BookmarkSubscribeRSS Feed
smm662002
Quartz | Level 8

Hello,

 

I am using SAS VIYA LTS 2025.03.

 

I have a number of large tables in CAS and I need to insert the content into DB2 tables.  The tables can not be moved from CAS to SPRE because some of the columns are quite large and will get truncated (these large columns correcpond to BLOB and CLOB Db2 data types)

 

Has anyone accomplished this before? 

 

Thank you,

Smm662002

4 REPLIES 4
SASKiwi
PROC Star

According to this SAS doc it is possible using PROC CASUTIL.

smm662002
Quartz | Level 8

Hello,

 

Thank you for your answer. Based on the documentation it seems to be possible. I have tried to use proc casutil, but I couldn't create a DB2 table but only a CAS table in a DB2 CASLIB. 

What do you think it might be the right casutil syntax for the scenario: source VIYA CAS table and target DB2 table?

 

Thank you,

smm662002

Sajid01
Meteorite | Level 14

Hello @smm662002 
Let the DBA's create the table and try uploading. Make sure you have all the required permissions.

SASKiwi
PROC Star

Google gives me this answer which I suggest you try (I don't have Viya to try):

caslib mydbreflib desc='My Relational Database CASLIB'
        dataSource=(srctype='<database_type>', /* e.g., 'oracle', 'postgres', 'teradata' */
                    server='<database_server_address>',
                    username='<database_username>',
                    password='<database_password>',
                    database='<database_name>');

    proc casutil;
        save casdata="<cas_table_name>" /* Name of the CAS table to save */
             outcaslib=mydbreflib /* CASLIB connected to your relational database */
             casout="<target_table_name>" /* Name for the table in the relational database */
             replace; /* Optional: Overwrites the target table if it exists */
    quit;