/*    TEST.C   */

#include stdio
#include ssdef
#include descrip

#define  CLI$_PRESENT  261401
#define  CLI$_NEGATED  229880

int main( )
{
        long int     status;
        static char  string[ 256 ];

        static char  parameter[ 80 ];
        unsigned short int    len_param;

        $DESCRIPTOR( string_desc, string );
        $DESCRIPTOR( parameter_desc, parameter );

        
        strcpy( string, "P1" );
        string_desc.dsc$w_length = 2;
        status = CLI$PRESENT( &string_desc );
        if( status == CLI$_PRESENT )
           {                                                     
              status = CLI$GET_VALUE( &string_desc 
                                     ,&parameter_desc
                                     ,&len_param );
              if( (status & 1) != 1 )  LIB$SIGNAL( status );
              parameter_desc.dsc$w_length = len_param;
           }
        else
           { 
              strcpy( string,"Enter parameter: " );
              string_desc.dsc$w_length = strlen( string );
              status = LIB$GET_INPUT( &parameter_desc
                                     ,&string_desc
                                     ,&len_param );
              if( (status & 1) != 1 )  LIB$SIGNAL( status );
              parameter_desc.dsc$w_length = len_param;
           }

        strcpy( string,"FULL" );
        string_desc.dsc$w_length = 4;
        status = CLI$PRESENT( &string_desc );
        if( (status & 1) == 1 )
           {
              printf("FULL qualifier is present\n");
           }

        strcpy( string,"DATE" );
        string_desc.dsc$w_length = 4;
        status = CLI$PRESENT( &string_desc );
        if( status == CLI$_PRESENT )
           {
              printf("DATE qualifier is present\n");
           }
        else if( status == CLI$_NEGATED )
           {
              printf("DATE qualifier is negated\n");
           }
        else
           {
              printf("DATE qualifier is NOT present\n");
           }

    exit( SS$_NORMAL );
}
