SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
helannivas88
Obsidian | Level 7

Hi,

 

Previously we have designed our SAS jobs in a such a way that data will be read from files( .xl or csv) and then will be appended into Netezza database using proc append statement.

 

If there are any errors , Error file (nzbad) will be generated during proc append statement . We have defined in proc append statement as 

 

BULKLOAD=YES

BL_DATAFILE='/data/sas/abc.dat'
BL_USE_PIPE=NO
BL_DELETE_DATAFILE=Yes
BL_OPTIONS="logdir'/data/sas/o' maxErrors 1"

 

Now we have migrated to DB2 database but I cant able to use the same option mentioned above.  For bulk load option , we have use BL_METHOD = CLILOAD , but when we use this we are not able to use BL_OPTIONS = "logdir ......maxErrors 1".

 

We have a requirement to generate a error file if there are any errors in the txt file as well we have to use CLILOAD option. Is there any way to achieve this ??? Thanks in Advance.

 

 

 

 

3 REPLIES 3
Tom
Super User Tom
Super User

I don't understand.  Why would there be errors loading the data that you already processed with SAS.

Shouldn't you catch the errors in the SAS code and publish any errors from there.

 

Or just load the data with native database tools and use whatever logging those tools provide.

Reeza
Super User

How are you connecting to your DB2 database, via Access to DB2 or Access to ODBC? 

And which SAS version are you using, Viya appears more restrictive. 

 

In general, it seems like using the CLILOAD does disable a bunch of other options, most of it is listed here:

 

https://documentation.sas.com/?docsetId=acreldb&docsetTarget=p1w9ial7770y6tn1rtfiuwtfg088.htm&docset...

 

The following are the available options when using CLILOAD, unfortunately most of the options you've specified are not available but perhaps some of the others allow you to get what you need?


@helannivas88 wrote:

Hi,

 

Previously we have designed our SAS jobs in a such a way that data will be read from files( .xl or csv) and then will be appended into Netezza database using proc append statement.

 

If there are any errors , Error file (nzbad) will be generated during proc append statement . We have defined in proc append statement as 

 

BULKLOAD=YES

BL_DATAFILE='/data/sas/abc.dat'
BL_USE_PIPE=NO
BL_DELETE_DATAFILE=Yes
BL_OPTIONS="logdir'/data/sas/o' maxErrors 1"

 

Now we have migrated to DB2 database but I cant able to use the same option mentioned above.  For bulk load option , we have use BL_METHOD = CLILOAD , but when we use this we are not able to use BL_OPTIONS = "logdir ......maxErrors 1".

 

We have a requirement to generate a error file if there are any errors in the txt file as well we have to use CLILOAD option. Is there any way to achieve this ??? Thanks in Advance.

 

 

 

 


Patrick
Opal | Level 21

@helannivas88 

Different database, different rules! Well, actually, it's quite similar for all databases but you still need to read the docu (link @Reeza posted) and use a valid combination of options specific for the database you're connecting to.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1176 views
  • 0 likes
  • 4 in conversation