You're using SQL Pass through in the two SQL queries, this means the output table is stored locally, after it runs on the server. That means you only have access to table on the server when doing a pass through query. The PIVOT table is local though, so it does not exist in the server so you cannot use it in your second query. You need to create the table on the server or nest the whole query together.
Please post your code directly into the forum, like this:
%LET RANGEBEG = '2017-12-01';
%LET RANGEEND = '2018-11-30';
%LET PAIDRANGE = '2018-11-30';
%LET CODE = svc.APPL_SVC_PV_NBR IN ('706067');
----------------------------------------------------------------------
PROC SQL;
CONNECT to teradata as td ( tdpid='pg' mode=teradata);
create table firstcut AS
select * from connection to td
(
SELECT *
FROM DATABASE
WHERE
BEGDATE BETWEEN &RANGEBEG AND &RANGEEND
AND svc.FINAL_ADJUD_DT LE &PAIDRANGE
AND svc.FINAL_ADJUD_DT IS NOT NULL
AND &CODE
AND svc.BUSI_LIN_CD IN ('COM')
AND svc.INT_PNLTY_IND <>'Y’
AND NOT ch.PRC_APPL_CD IN ('UMC','IKA')
AND svc.ADJUD_IND = 'Y'
AND svc.LAST_VER_FULL_ADJUD_LCS_IND ='Y'
);
quit;
----------------------------------------------------------------------
PROC SQL;
create table PIVOT as
SELECT MEMNO
FROM Results
GROUP BY MEMNO
ORDER BY MEMNO ASC;
QUIT;
----------------------------------------------------------------------
PROC SQL;
CONNECT to teradata as td ( tdpid='pg' mode=teradata);
create table firstcut1 AS
select * from connection to td
(
SELECT *
FROM DATABASE
WHERE
BEGDATE BETWEEN '2017-12-01' AND '2018-11-30'
AND svc.FINAL_ADJUD_DT LE &PAIDRANGE
AND svc.FINAL_ADJUD_DT IS NOT NULL
AND MEMNO IN (select MEMNO from PIVOT)
AND svc.BUSI_LIN_CD IN ('COM')
AND svc.INT_PNLTY_IND <>'Y'
AND NOT ch.PRC_APPL_CD IN ('UMC','IKA')
AND svc.ADJUD_IND = 'Y'
AND svc.LAST_VER_FULL_ADJUD_LCS_IND ='Y'
);
quit;