Step-by-step guide

Easy peasy. Use the "defined" function which takes a single key name as argument. e.g.

grib_filter example
if (defined(Latin1)) {
    print "Key Latin1 is there for this message";
}