optimist:
    proc options(main);
    %replace
        true   by '1'b,
        false  by '0'b,
        nwords by 5;
    dcl
        negative (1:nwords) char(8) var static initial
            (' never',' none',' nothing',' not',' no'),
        positive (1:nwords) char(10) var static initial
            (' always',' all',' something','',' some'),
        upper char(28) static initial
            ('ABCDEFGHIJKLMNOPQRSTUVWXYZ. '),
        lower char(28) static initial
            ('abcdefghijklmnopqrstuvwxyz. ');
    dcl
        sent char(254) var,
        word char(32)  var;
    dcl
        (i,j) fixed;

        do while(true);
        put skip list('What''s up? ');
        sent = ' ';
            do while
                (substr(sent,length(sent)) ^= '.');
            get list (word);
            sent = sent !! ' ' !! word;
            end;
        sent = translate(sent,lower,upper);
        if verify(sent,lower) ^= 0 then
            sent = ' that''s an interesting idea.';
            do i = 1 to nwords;
            j = index(sent,negative(i));
            if j ^= 0 then
                sent = substr(sent,1,j-1) !!
                   positive(i) !!
                   substr(sent,j+length(negative(i)));
            end;
        put list('Actually,'!!sent);
        put skip;
        end;
    end optimist;
