MSSQL syntax error - MSG 156/MSG 102
pretty green on MS SQL, and I have been given a query to run on our server. The query keeps popping up the following error:

    Msg 156, Level 15, State 1, Line 2
    Incorrect syntax near the keyword 'as'.
    Msg 102, Level 15, State 1, Line 6
    Incorrect syntax near ','

Can anyone see an issue with the below query?

    RECPT as
    (select PRDOCO, PRDCTO, prlnid, SUM(prarec)/100 AREC, PRCRCD, PRCRR/10000000 RExchng, sum(PRFREC)/100 FAREC
    from PRODDTA.F43121
    where PRMATC = 1 and PRDGL between 112182 and 112195
    group by PRDOCO, PRDCTO, prlnid, PRCRCD, PRCRR/10000000),
    PODet as
    (select pdco, pdan8, abalph, pddoco, pddcto, pdlnid, pdlnty, pdtrdj, pddrqj, pddsc1,
    pdcrcd, pdcrr/10000000 CurRate,
    pdaexp/100 OrigAmt, pdaopn/100 OpenAmt, pdarec/100 RecAmt,
    PDFEC/100 FOrigAmt, PDFAP/100 FOpnAmnt, PDFREC/100 FRecAmt
    from PRODDTA.F4311
    left outer join PRODDTA.F0101 on
    PDAN8 = aban8
    where PDTRDJ < 112183)
    select pdco, pdan8, abalph, pddoco, pddcto, pdlnid, pdlnty, pdtrdj, pddrqj, pddsc1,
    pdcrcd, CurRate, PRCRCD, RExchng,
    OrigAmt, OpenAmt, RecAmt, AREC,
    FOrigAmt, FOpnAmnt, FRecAmt, FAREC
    from PODet
    left outer join RECPT on
    pddoco = PRDOCO and pddcto = PRDCTO and pdlnid = prlnid
MSSQL syntax error - MSG 156/MSG 102
===

pretty green on MS SQL, and I have been given a query to run on our server. The query keeps popping up the following error:

    Msg 156, Level 15, State 1, Line 2
    Incorrect syntax near the keyword 'as'.
    Msg 102, Level 15, State 1, Line 6
    Incorrect syntax near ','

Can anyone see an issue with the below query?

    RECPT as
    (select PRDOCO, PRDCTO, prlnid, SUM(prarec)/100 AREC, PRCRCD, PRCRR/10000000 RExchng, sum(PRFREC)/100 FAREC
    from PRODDTA.F43121
    where PRMATC = 1 and PRDGL between 112182 and 112195
    group by PRDOCO, PRDCTO, prlnid, PRCRCD, PRCRR/10000000),
    PODet as
    (select pdco, pdan8, abalph, pddoco, pddcto, pdlnid, pdlnty, pdtrdj, pddrqj, pddsc1,
    pdcrcd, pdcrr/10000000 CurRate,
    pdaexp/100 OrigAmt, pdaopn/100 OpenAmt, pdarec/100 RecAmt,
    PDFEC/100 FOrigAmt, PDFAP/100 FOpnAmnt, PDFREC/100 FRecAmt
    from PRODDTA.F4311
    left outer join PRODDTA.F0101 on
    PDAN8 = aban8
    where PDTRDJ < 112183)
    select pdco, pdan8, abalph, pddoco, pddcto, pdlnid, pdlnty, pdtrdj, pddrqj, pddsc1,
    pdcrcd, CurRate, PRCRCD, RExchng,
    OrigAmt, OpenAmt, RecAmt, AREC,
    FOrigAmt, FOpnAmnt, FRecAmt, FAREC
    from PODet
    left outer join RECPT on
    pddoco = PRDOCO and pddcto = PRDCTO and pdlnid = prlnid