BookmarkSubscribeRSS Feed
Kadia
Calcite | Level 5

Hi all,

 

I wanted to create a constant unique variable n  for each  ITEM_ID and after that transposing DATA table for having  each ITEM_ID with  multiple date

see attached  tableCapture.PNG

 

Thank you for your help

8 REPLIES 8
Kadia
Calcite | Level 5

Thanks for reply but i need to know how to create unique id then doing the transpose

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

what is your item_id is it not unique?

 

Kadia
Calcite | Level 5

It is but as it's not integer it can group correctly

i have this error message ERROR: Data set WORK.QUERY_FOR_ITEM_SMRY_0001 is not sorted in ascending sequence. The current BY group has ITEM_ID =
       7262314317311375 and the next BY group has ITEM_ID = 0104617002383014.
NOTE: The SAS System stopped processing this step because of errors.

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

preform a proc sort on the information prior to the transpose.

give more information so that we can assist rather than guess.

 

ballardw
Super User

@Kadia wrote:

It is but as it's not integer it can group correctly

i have this error message ERROR: Data set WORK.QUERY_FOR_ITEM_SMRY_0001 is not sorted in ascending sequence. The current BY group has ITEM_ID =
       7262314317311375 and the next BY group has ITEM_ID = 0104617002383014.
NOTE: The SAS System stopped processing this step because of errors.


Show entire data step or procedure call along with the error. Copy from the log and paste into a code box opened using the forum's {I} or "running man" icon. The message windows will reformat text reducing the value of the diagnostics that SAS sometimes supplies with errors.

 

But that is a pretty clear error. You need to sort the data before what ever you were doing. The BY statement in the sort should look the same as the By statement is whatever threw the error.

Tom
Super User Tom
Super User

Where are you getting those numbers? There is a limit to the number of digits of precision that SAS can store in a number.

 

507   data _null_;
508   x=constant('exactint');
509   put x= comma30.;
510   run;

x=9,007,199,254,740,992
ballardw
Super User

@Kadia wrote:

Thanks for reply but i need to know how to create unique id then doing the transpose


Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

It is real hard to write code against pictures.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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