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

I'm not exactly sure what is happening, but I need to replace one data set with another in a library.  The current data set has 710 columns, the new data set has 715 columns.  Every time I replace the current with the new, whether it is through code or direct Windows copy, the added columns disappear.  The columns are the last 5 in the data set.  Why is this happening and what can I do to fix it?

1 ACCEPTED SOLUTION

Accepted Solutions
ErikLund_Jensen
Rhodochrosite | Level 12

Hi @arjessup 

 

You need to give us some more details about your SAS products and process. Are the added columns missing when you browse the data set, or when you run a proc contents? 

 

If you are using a SAS product that works with SAS metadata, like DI Studio, SAS only sees the columns defined in metadata. You get an error if a column does not exist in the physical table, and a column in the physical table is ignored, if it is not present in the table metadata..

 

This is a common problem in DI Studio when working with user defined transformations or user-written code, where the physical output table is created by the code independent of metadata. I often forget to update table metadata after the transformation is run.

 

View solution in original post

5 REPLIES 5
Tom
Super User Tom
Super User

Show us your SAS log from running the code that is trying to "replace" the dataset.

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

have you tried to delete the data set then run your code to create the new data table with the extra columns?

ErikLund_Jensen
Rhodochrosite | Level 12

Hi @arjessup 

 

You need to give us some more details about your SAS products and process. Are the added columns missing when you browse the data set, or when you run a proc contents? 

 

If you are using a SAS product that works with SAS metadata, like DI Studio, SAS only sees the columns defined in metadata. You get an error if a column does not exist in the physical table, and a column in the physical table is ignored, if it is not present in the table metadata..

 

This is a common problem in DI Studio when working with user defined transformations or user-written code, where the physical output table is created by the code independent of metadata. I often forget to update table metadata after the transformation is run.

 

arjessup
Fluorite | Level 6

They are not in the view.  When I run PROC CONTENTS, they are in the data set.

ErikLund_Jensen
Rhodochrosite | Level 12

Hi @arjessup 

 

Which means that your code is working, because the data set is replaced.  

 

You say "they are not in the view". Do you mean you access the data set through a separately stored view with the filetype sas7bvew? - if so, you must manually update the view to include the new variables.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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