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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1229 views
  • 0 likes
  • 2 in conversation