Problem solved. Apparently, the error was launching GAMS from its installation folder. The correct procedure is to add the installation folder to the PATH variable, and to call GAMS from another folder, for instance the folder containing your GAMS code.

@okaradeniz
I applied the second solution.
So I put all my gms files in one folder, "mymodel". Before calling an individual gms file, I would change directories:
cd C:\mymodel
And then call my gms file, for instance:
gams 01_macro_part1.gms
Can you check whether this works?