BookmarkSubscribeRSS Feed
Saugata
Obsidian | Level 7

Hi,

I am executing the below code in both SAS 9.2 and 9.3:

data kk;

var='000042';

var2=input(var,hhmmss6.);

format var2 time8.;

run;

In SAS 9.2 (as well as in 9.1.3) the value of var2 is coming up as 0:00:42 (best12. value is 42), which is correct. But in 9.3 it is appearing as 42:00:00 (best12. value 151200). It seems SAS is just disregarding leading zeroes from the text field in 9.3.

Is there any change regarding this in SAS 9.3 for Input function (or informats).? I am really puzzled at why this correct thing be changed during upgrade, or is it a bug that crept in while moving on to 9.3.

I would really appreciate any insight on this.

Thanks & Regards,

Saugata Mukherjee.

1 REPLY 1
Kurt_Bremser
Super User

When the same code produces different results between SAS versions, and said difference is not noted somewhere in the documentation, it is clearly a matter for SAS tech support. Open a track there.

We had a similar problem in the behaviour of the $ebcdic format between 6.12/8.2 that lead to a fix.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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