From: Terry Kennedy [terry@spcunb.spc.edu]
Sent: Wednesday, September 29, 1999 4:03 PM
To: Info-VAX@Mvb.Saic.Com
Subject: Re: Setting DCL symbol from within a program

Matti Salo <msalo@juhani.decus.fi> writes:
> Does anybody have C-code readily available to set a DCL symbol
> from within an application.

  This is ripped out of a program we use here. It should give you all the
hints you need.

#include <descrip.h>

	extern int	LIB$SET_SYMBOL();	/* may not be needed	*/

	static	$DESCRIPTOR(symnam,"LASTCOOKIE");
	static	struct	dsc$descriptor_s	symval;

	if (!noenvset) {
	    sprintf(envstr,"%ld",which);
	    symval.dsc$w_length = strlen(envstr);
	    symval.dsc$a_pointer = envstr;
	    symval.dsc$b_class = DSC$K_CLASS_S;
	    symval.dsc$b_dtype = DSC$K_DTYPE_T;
	    i = 2;			/* Store in global table	*/
	    LIB$SET_SYMBOL(&symnam, &symval, &i);
	}

	Terry Kennedy		  Operations Manager, Academic Computing
	terry@spcvxa.spc.edu	  St. Peter's College, Jersey City, NJ USA
        +1 201 915 9381 (voice)   +1 201 435-3662 (FAX)
