BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rara
Calcite | Level 5

HI There,

 

I have a table already available in Db2 and i am running my sas code to load into this table from another sas table, using pass through facility.

And it is a proc append running behind.

The columnnames are same both in sas and DB2.

Now  i am getting some unusual error from Db2 on one column name in the table, and the error message is as folows,

 

ERROR: [IBM][CLI Driver][DB2/AIX64] SQL0206N  "column_name" is not valid in the context

 

Someone please help me on this.

 

Regards,

Ratheesh Rajan

 

1 ACCEPTED SOLUTION
6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Can you post the SQL, and a describe table from the database.  Without seeing either its hard to say.

rara
Calcite | Level 5

Thanks for ur respnse..

please find below the table structure in Db2 and the piece of sas code to load the data used with passthorugh.

 

CREATE TABLE "SOR_IDW"."table_name" (

  "COMPANY"    VARCHAR(7),

  "SPLITCLMTYPE"             CHARACTER(2),

  "HAZARDS"       VARCHAR(10),

  "DATEOCCURREDFROM"            DATE,

  "DATEOCCURREDTO"   DATE,

  "POSTCODE"    VARCHAR(42),

  "EXCLUDING"  VARCHAR(21),

  "EXCLUDING_WORDS"                VARCHAR(151),

  "ADDITIONAL_WORDS_TO_SEARCH_WORDS" VARCHAR(71),

  "AUTHOR"        VARCHAR(15),

  "DATE_CREATED"          DATE

)

 

SAS code :

proc append DATA=&sourceLib..&sourceDataset.

              BASE= &TargetLib..&TargetTable. (BULKLOAD= YES   BL_METHOD=CLILOAD) force;

       run;  

 

And the issue is with the column ADDITIONAL_WORDS_TO_SEARCH_WORDS.

Kurt_Bremser
Super User

Are those quotes around column names really necessary? I never see them in SQL query statements run on our UDB/DB2.

Since ADDITIONAL_WORDS_TO_SEARCH_WORDS is already 32 bytes, the additional quotes might trigger a length restriction somewhere on the way between SAS and DB2.

LinusH
Tourmaline | Level 20

ADDITIONAL_WORDS_TO_SEARCH_WORD is longer than 32 chars, something that SAS does not support.

A PROC CONTENTS in the DB2 libref should reveal that (and compare with the source SAS data set).

Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1008 views
  • 0 likes
  • 4 in conversation