?
Solved

sas-update

Posted on 2012-04-11
3
Medium Priority
?
306 Views
Last Modified: 2012-04-20
hi,
i am upating a table using table loader which works fine if i run very first time and populate
column as (| Emp: (aa, bb (00846XXX); aa, bb (07041XXX))

if i run it again this column gets dups as
(| Emp: (aa, bb (00846XXX); aa, bb (07041XXX))(| Emp: (aa, bb (00846XXX); aa, bb (07041XXX))

i don't want that if it sees | Emp: string don't update that column just skip it.



proc sql ;
         /* update existing records in the master table  */
         update QSMRTPDI.EXCP_FCT as m
            set EXCP_ADDTL_INFO_TEXT = (select EXCP_ADDTL_INFO_TEXT from &etls_lastTable as t
                                where m.ITEM_ID = t.ITEM_ID and
                                      m.EXCP_TYP_CDE = t.EXCP_TYP_CDE and
                                      m.WC_ID = t.WC_ID and
                                      m.SVCTKT_NUM = t.SVCTKT_NUM and
                                      m.EXCP_EVT_DTE = t.EXCP_EVT_DTE and
                                      m.EXCP_EVT_TME = t.EXCP_EVT_TME)
               where ITEM_ID in (select distinct ITEM_ID from &etls_lastTable) and
                        EXCP_TYP_CDE in (select distinct EXCP_TYP_CDE from &etls_lastTable) and
                        WC_ID in (select distinct WC_ID from &etls_lastTable) and
                        SVCTKT_NUM in (select distinct SVCTKT_NUM from &etls_lastTable) and
                        EXCP_EVT_DTE in (select distinct EXCP_EVT_DTE from &etls_lastTable) and
                        EXCP_EVT_TME in (select distinct EXCP_EVT_TME from &etls_lastTable)
         ;
         
      quit;
0
Comment
Question by:sam2929
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:wshark83
ID: 37832319
i assume "| Emp: " is in EXCP_ADDTL_INFO_TEXT field

then you can add an additional and statement to say

substr(EXCP_ADDTL_INFO_TEXT,1,6) ne "| Emp:"
0
 

Author Comment

by:sam2929
ID: 37832794
yes we can but it can be 1,6 i not fixed can we use index stmt
0
 
LVL 6

Accepted Solution

by:
wshark83 earned 2000 total points
ID: 37833157
yes you can use the index function index(EXCP_ADDTL_INFO_TEXT,"| Emp:") = 0
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question