BookmarkSubscribeRSS Feed
sasg
Calcite | Level 5

Hi All,

 

I need to load the data from attached files into database table,the no. of columns and colum,n names keep on changing. Is there any way we can read the columns after importing and creating database table based on the input.

 

Because it is recurring process want to automate it rather than working on each time the file we received.

 

Let me know the process to read database table and assigning the index(I want S3544 column to be index instead of 1st column not sure how to put that as index because column name is changing.)

 

Thanks all in advance.

1 REPLY 1
ballardw
Super User

@sasg wrote:

Hi All,

 

I need to load the data from attached files into database table,the no. of columns and colum,n names keep on changing. Is there any way we can read the columns after importing and creating database table based on the input.

 

 


The highlighted text violates several rules of formal database design.

If this stuff is supposed to end up in a single table tell whoever is responsible for this project that the programming costs, which will occur everytime the incoming file layout changes is likely to become noticeable. I have dealt with this in past as a contractor and had to explain to project staff from a very large well-known computer related firm that changing file layouts and contents had a cost in man hours for manipulating the data before we could get the pieces into a standard database.

 

If there are Common elements that do not change it may be possible to select those and upload them in a consistent manner. May. But it is still going to have a cost in person time every time the file changes.

 

I can't trust Excel files from unknown sources so can't look at your data. Note that if Excel is the actual data transfer mechanism you may also have issues with variable types changing from numeric to character and similar. It gets even worse with databases that specify numerics as different "sizes". If the initial data indicates a field is integer and later you get decimal values or possibly longer integer than expected issues will arise.

 

There should be a formal agreement as to what the file layouts and contents will be before ever starting such a project.

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1458 views
  • 0 likes
  • 2 in conversation