Hello folks,
Happy New Year!
I have a folder like the attached. Then I have a small process in VBS trying to find out if SAS9 exists but it's not working. Here is part of the code.
....
....
For Each file in folder.Files
name = LCase(file.Name)
If InStr(LCase(Name), ".sas") Then pgm = Name
If InStr(LCase(Name), "sas 9") Or InStr(LCase(Name), "sas9") Then
sasflag = "9"
MsgBox "Run SAS 9"
Exit For
Else
sasflag = "8"
MsgBox "Run SAS 8"
Exit For
End If
'msgbox name & " " & pgm
Next
....
....
The msgbox statements show !!!!USE SAS 9!!!! is there but won't pick it up; still telling me Run SAS 8. What's going on? Did I do something wrong in the IF/THEN statements, or InStr() not working in a situation like this?
Please help me out there.
Thanks in advance.
Happy New Year!
I have a folder like the attached. Then I have a small process in VBS trying to find out if SAS9 exists but it's not working. Here is part of the code.
....
....
For Each file in folder.Files
name = LCase(file.Name)
If InStr(LCase(Name), ".sas") Then pgm = Name
If InStr(LCase(Name), "sas 9") Or InStr(LCase(Name), "sas9") Then
sasflag = "9"
MsgBox "Run SAS 9"
Exit For
Else
sasflag = "8"
MsgBox "Run SAS 8"
Exit For
End If
'msgbox name & " " & pgm
Next
....
....
The msgbox statements show !!!!USE SAS 9!!!! is there but won't pick it up; still telling me Run SAS 8. What's going on? Did I do something wrong in the IF/THEN statements, or InStr() not working in a situation like this?
Please help me out there.
Thanks in advance.