Since macros execute in the SAS session (Compute Server) and not on the CAS server, you cannot use a macro variable to track the progress of a CAS action while it is running.
To bridge this gap, always use the &SYSCC macro variable or the _status dictionary generated by CAS actions. The macro language waits for CAS to finish its job, receives a return code, and then decides what text to generate next. If your macro logic depends on data values inside a CAS table, you must first use an action like table.fetch to bring those values back to the SAS session before the macro can "see" them.