BookmarkSubscribeRSS Feed
learn_SAS_23
Quartz | Level 8

We are Having SCD Type 2 tables almost 200 tables , with 250 columns in each table.

for

 

EX: STUDENT details

STUDENT_ID    VALID_FROM_DT       VALID_TO_DT        NAME      CITY     CONTACT_NO    BRANCH
1                           04-April-2018             10-April-2018            XYZ    Chennai    12345                   CSE

1                           10-April-2018             31-DEC-2055           XYZ      MUMBAI   87777                 CSE

 

looking for some generic solution where to exact only mismatch columns for this case the output should be

 

OUTPUT :

STUDENT_ID       VALID_FROM_DT      VALID_TO_DT               CITY      CONTACT_NO
1                            04-April-2018              10-April-2018               Chennai    12345
1                            10-April-2018               31-DEC-2055              MUMBAI    87777

 

Can this solution is possible , if so can it be some generic wherei can use this for all my 200 tables.

Thanks in Advance .

3 REPLIES 3
Community_Guide
SAS Moderator

Hello @learn_SAS_23,


Your question requires more details before experts can help. Can you revise your question to include more information? 

 

Review this checklist:

  • Specify a meaningful subject line for your topic.  Avoid generic subjects like "need help," "SAS query," or "urgent."
  • When appropriate, provide sample data in text or DATA step format.  See this article for one method you can use.
  • If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition. Use the Photos button to include the image in your message.
    use_buttons.png
  • It also helps to include an example (table or picture) of the result that you're trying to achieve.

To edit your original message, select the "blue gear" icon at the top of the message and select Edit Message.  From there you can adjust the title and add more details to the body of the message.  Or, simply reply to this message with any additional information you can supply.

 

edit_post.png

SAS experts are eager to help -- help them by providing as much detail as you can.

 

This prewritten response was triggered for you by fellow SAS Support Communities member @Reeza

.
ballardw
Super User

Define the rules for determining a "mismatch".

For instance are the apparent date values shown involved in the "mismatch" for selecting those records? If there are any variables not to be considered you would need to mention them.

 

learn_SAS_23
Quartz | Level 8
To determine as a mismatch, since it's a scd type 2 Table,if there is any
change in previous record in any of the columns, then a new record will be
created,with the statical columns such as valid date from and valid date
to,

So, if any columns in row 1 is not equal to row 2 then it is considered as
a mismatch, we just need to display the specific mismatched column,

Since we have almost 200 table's with more columns , looking for some
generic solution , if I can pass a table name in the macro code , the
output data set with a specific mismatched columns as shown in the example.

Thanks


Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 871 views
  • 0 likes
  • 3 in conversation