How to set datadir and see all environment variables

Setting GMT_DATADIR=path does what I want.

A bit curious how this relates to the datadir in,

$ gmt --show-datadir
Not set