Logging group IO

hi, this is the script ive write where logging group tags and write it in CSV file per minute (for testing)
if i wanted to log group io , where to add and where to change
ive tried to put LOGGROUPIO “ABC” behind “GOTO WriteRecord”
and it pop up the error :
variable not found :PUT 1, Time$ “,”+ STR$ n +"," + CHR$(13)+ CHR$(10)

any help will be appreciate

fileName$ = “test1.csv”
ONDATE 1, “* * * * 1-5”," “GOTO WriteRecord” , LOGGROUPIO “ABC” "
n = LOGGROUPIO “ABC”
END

WriteRecord
WriteRecord:
CLOSE 1
OPEN fileName$ FOR BINARY APPEND AS 1
PUT 1, Time$ “,”+ STR$ n +"," + CHR$(13)+ CHR$(10)
CLOSE 1
END

Hello,

For the CHR$, are you trying to transfer the ASCII code, or have it display the actual number?

I would tie the complete string to a single string variable first.

$t = time$ + “,” + STR$ n + “,”+…

Then use the PUT command as follows:

PUT 1, $t

it was for transfer the ASCII code
ok i will try to change to code and try it asap ty