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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 6 replies
  • 2149 views
  • 0 likes
  • 4 in conversation