Hello, Yes, you can do all of this. Use the STRCMP function to compare the strings. (try "SHOW FUNCTION *STR* to see a list of most of the functions that operate on strings). There are a couple of things you can do to take care of the case where there are no units. One is to just add a known string when defining the symbol unt, and take that into account when making the comparison. So your example could go something like this: use monthly_navy_windsAnother option would be to use the attribute handling syntax in Ferret to first check whether the variable has a units attribute. Here I also show how to convert the units to uppercase before making the comparison. If the input file has units listed as "CM" or "cm" you would still want to treat them the same way" use monthly_navy_winds Sudheer Joseph wrote: Dear Users, Is there any way in ferret to do string comparison, ie, I want to use the unit information in netcdf variable and do action based on that. Also if there is no unit for the variable the code should not break instead continue echoing that there was no unit. it could be some thing like below use monthly_navy_winds def sym unt=`uwnd,r=ubnit` if (($unt) eq "cm") then nwnd=uwnd/100 else nwnd=uwnd end if though the above code is written it will break if a data file do not have unit information |