SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Shakti_Sourav
Quartz | Level 8

issue1.PNG

I got this Error after Updating the data.. is it data level Error or Programming level Error ???

Because Before data Update, This logic was working Properly.

 

Suggest me what will I Do ?

Variables and Data Type in User WrittenVariables and Data Type in User WrittenVariables and Data Type in User WrittenVariables and Data Type in User Written

Thank You!!!

5 REPLIES 5
ErikLund_Jensen
Rhodochrosite | Level 12

Hi @Shakti_Sourav 

It is difficult to say from the available information. The source to the user-written transformation is not shown, and the log is not included. Please do the following:

  1. Run the code again.
  2. Perform a metadata update on the input data set to the user-written transformation (right click on the work tables). One thing is the metadata registrations you see in the column list, another is the physical reality behind it, and the userwtitten transformation does not care about metadata.
  3. Post the step log instead of a screenshot of the error box.
Patrick
Opal | Level 21

You would need to share the SAS log with us. Just guessing based on what you show us:

You've changed somewhere in metadata a column from numerical to character and you've got some expression in the code which expects the variable to be character.

You are using a view as input. From the looks of it the column in the physical data the view uses is still numerical. Changing the data type in metadata doesn't change the data type in the physical data. This only happens when you run the code that re-creates the physical data using the changed metadata. 

 

Make sure the metadata data type which creates the physical data use by the view has the right data type and run your DI job from the node which then creates the physical data. ....and should this node not always recreate the physical data (i.e. because it's an append) then manually delete the physical SAS table and re-run the whole job.

 

And on a side note: If you've got a user written code node then change the default text "user written" to something more descriptive like "uw - <very short description what the logic does"

Shakti_Sourav
Quartz | Level 8

issue3.jpg

 

I got this error in User written log. 

Kurt_Bremser
Super User

This user written code has more than 2500 lines, what you show us is just the symptom, not the cause. What we see is that the dataset is not a dataset, but a SQL view. Look where the view is defined, and then see which of the source variables has the type character when numeric is expected.

Patrick
Opal | Level 21

For testing: Change in the node that creates view W3ZR3S9 the output to table and then execute this node. That will tell you directly where things don't match.

Fix the issue and only then change back to a view.

Also: At least for "important" tables it's worth to put in the little bit of extra effort and change the generated table name to something more "human readable". 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2644 views
  • 0 likes
  • 4 in conversation