[Tutor] Re[2]: [Tutor] ksh and SAS questions

David Ascher da@ski.org
Fri, 4 Jun 1999 13:46:33 -0700 (Pacific Daylight Time)


On Fri, 4 Jun 1999 adeline_j_wilcox@ccMail.Census.GOV wrote:

>      Well, I can't see the error in the following script. Running 
>      SunOS 5.5.1. When I run my Python script, I get this error 
>      message:
>      
> Traceback (innermost last):
>   File "recheck.py", line 14, in ?
>     month = os.environ['CATI']
>   File "/usr/local/lib/python1.5/UserDict.py", line 12, in __getitem__
>     def __getitem__(self, key): return self.data[key]
> KeyError: CATI

This means that there is no environment variable called CATI when you run
line 14 -- if that was supposed to be set by

>     12  os.system('/op/ctl/prod/scripts/setcm.ksh')

then there's something wrong with that script.  I don't know the Korn
shell, but it could be that you need to specify something in that shell to
make the environment variables "stick" after execution.  In bash, I
believe it's the "export" command.

--david