How can I put values into the environment of the program that called my awk program?
Short answer, you can't. Unix ain't Plan 9, and you can't tweak the parent's address space.
(DOS isn't even Unix, so it lets any program overwrite any memory location, including the parent's environment space. But the details are [obviously] going to be fairly icky. Avoid.)
Longer answer, write the results in a form the shell can parse to a temporary file, and have the shell "source" the file after running the awk program:
awk 'BEGIN { printf("NEWVAR='%s'\n", somevalue) }' > /tmp/awk.$$ . /tmp/awk.$$ # sh/ksh/bash/pdksh/zsh etc rm /tmp/awk.$$
With many shells, you can use `eval', but this is also cumbersome:
eval `awk 'BEGIN { print "NEWVAR=" somevalue }'`
Csh syntax and more robust use of quotation marks are left as exercises for the reader.