Code:
    208 EXEC SQL DECLARE GLOBAL TEMPORARY TABLE Next_Step
    209     AS
    210     SELECT MIN(pr.step), ms.cin
    211           from psr_coil_mstr ms,msd_mfg_to_mo_lot m,msd_proc_rte pr
    212           where  m.mo=ms.mo
    213                  and m.mo_lot=ms.mo_lot
    214                  and pr.psu_key=m.psu_key
    215                  and ms.next_step_cc=996
    216                  and ms.defunct_flag != 'Y'
    217                  and pr.step>ms.next_step
    218                  and pr.cc != 171
    219                  and pr.cc != 173
    220          group by ms.cin
    221           on commit preserve rows
    222           with norecovery
    223     EXEC SQL COMMIT;
The error I get is:

%% Error in file cooling_rpt.sc, Line 208:
E_EQ0244 Syntax error on 'Next_Step'.

make: 1254-004 The error code from the last command is 255.