Microsoft KB Archive/832503

= The SMS Installer does not correctly compare string values that start with numbers =

Article ID: 832503

Article Last Modified on 6/27/2007

-

APPLIES TO


 * Microsoft Systems Management Server 2.0 Service Pack 5

-





SYMPTOMS
The Microsoft Systems Management Server (SMS) Installer &quot;If/While Statement&quot; script item (action) does not correctly work with the &quot;Expression True&quot; operation when the values to compare are two strings that start with numbers, but that contain non-numeric characters.

For example, the expression &quot;2003-08-25&quot; = &quot;2003/07/11&quot; is incorrectly evaluated as TRUE. The same problem occurs if you use &quot;Expression True&quot; to evaluate variables. Additionally, the &quot;Set Variable&quot; action has the same problem with the &quot;Evaluate Expression&quot; operation.



CAUSE
The SMS Installer treats a string that starts with a number as a numeric value. The SMS Installer compares the integers only up to the first non-numeric character. For example, in the strings &quot;2003-08-25&quot; and &quot;2003/07/11&quot;, the SMS Installer stops at the - and /characters.



RESOLUTION
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that this article describes. Apply this hotfix only to systems that are experiencing this specific problem.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

  Date         Time   Version         Size       File name     Platform -  09-Jan-2004  19:03  2.0.158.0       9,797,632  Smsimain.exe  x86

Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

To install this fix, run the Smsimain.exe program, and then follow the instructions.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.



WORKAROUND
To work around this issue for the &quot;If/While Statement&quot; script item, follow these steps:
 * 1) Assign the first string that you want to compare to a variable.
 * 2) Specify the variable name in the If Variable field.
 * 3) Select Equals or Not Equal as the operator and add the second string to the The Value field.



MORE INFORMATION
The hotfix that is described in this article updates only the following actions and operators in the SMS Installer:
 * &quot;If/While Statement&quot; - &quot;Expression True&quot;
 * &quot;Set Variable&quot; - &quot;Evaluate Expression&quot;

Additionally, this update only affects the equality (=) and non-equality (<>) evaluations. The other evaluations, like <, >, <=, and >=, work only with whole numbers; they do not work with strings.

After you install the hotfix, the two SMS Installer script items examine the data that you want to compare for any non-numeric characters. If the script item finds a non-numeric character, the script item treats the data as a string instead of as a number.

The return value from the &quot;Set Variable&quot; script item in combination with the &quot;Evaluate Expression&quot; operation may sometimes be -1 instead of 1. (This issue also occurs with earlier versions of the SMS Installer. The issue is not specific to this hotfix.) A value of -1 is returned when you use the <> (non-equality) operator to compare two strings and the expression evaluates to TRUE. Microsoft recommends that you look for a value that is not equal to 0 to determine if an expression evaluates to TRUE. This issue does not affect the &quot;If/While Statement&quot; script item in combination with the &quot;Expression True&quot; operation.

Keywords: kbhotfixserver kbqfe KB832503

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.