Hi everyone, would appreciate your help in this. This code is the simplified version of the original code, I have tried using '%macro SAMPLE:' it still did not work, I could not figure out what went wrong in this code as it has always been able to run until a couple of days back. Thanks in advance your help. %MACRO SAMPLE();
PROC SQL;
CREATE TABLE ALL_KEYS AS
SELECT DISTINCT KEYS, ROOM
FROM ALL_DATA;
QUIT;
PROC SQL;
CREATE TABLE ALL_KEYS AS SELECT * , MONOTONIC() AS SEQ FROM ALL_KEYS;
QUIT;
%let l = 1;
%let keycount = %obscnt(ALL_KEYS);
%do %while(&l le &keycount);
PROC SQL NOPRINT;
SELECT COMPRESS(KEYS), ROOM INTO:KEY,:ROOM FROM ALL_KEYS WHERE SEQ = &l.;
quit;
%let ROOM = %TRIM(&ROOM.);
%let KEY = %TRIM(&KEY);
PROC SQL;
CREATE TABLE DATA_&KEY. AS SELECT
PUT(DATEPART('CHECK IN DATE'n), EURDFDE7.) AS DATE,
PUT(TIMEPART('CHECK IN TIME'n), TIME6.2) AS TIME,
CAT("'",CUSTOMERNO) AS CUSTOMERNO
FROM ALL_DATA;
QUIT;
%let l = %eval(&l + 1);
%end;
%mend SAMPLE;
%SAMPLE;
... View more