$Y contains an integer value ranging from 0 to 65,535, specifying the vertical position of a virtual cursor in the current output record. $Y=0 represents the top row or line.
Every OPEN device has a $Y. However, GT.M only accesses $Y of the current device. Therefore, be careful when sequencing USE commands and references to $Y.
When GT.M finishes the logical record in progress, it generally increments $Y. GT.M recognizes the end of a logical record when it processes certain GT.M format control characters, or when the record reaches its maximum size, as determined by the device WIDTH, and the device is set to WRAP. The definition of "logical record" varies from device to device. For an exact definition, see the sections on each device type. FILTER and the device LENGTH also have an effect on $Y.
SET $Y does not automatically issue device commands or escape sequences to reposition the physical cursor.