I got this:
SELECT F1 ASSIGN TO "test.dat".
I get this error at the last line: "Invalid ASSIGN name" which is "test.dat". I've also tried the whole file path but it still doesn't work. The file is in the same directory as the program file. Anything on this?
This will work for a flat file for INPUT, for OUTPUT and also for EXTEND
ASSIGN TO 'C:\MyFolder\FILEA.txt'
ORGANIZATION IS LINE SEQUENTIAL
ACCESS IS SEQUENTIAL.
BTW, the use of quotes or apostrophes don't make any difference so long as you use them in pairs
You can have both in the one program no problem
VALUE 'ONE' and VALUE "ONE" means the same thing to the compiler
For an indexed file (some call it ISAM - Indexed Sequential Access Method) look in the documentation and vary the above sample code a little (lines 3 & 4)
I don't see anything wrong with the whole SELECT clause. Do you get the error when you compile or run the application? Can you attach a screenprint showing the error please.
Thanks for providing the screenprints, but I still don't see anything that would cause this compiler error. I don't even see COBCH1588 in the documentation.
Attached is a very similar to your sample program. Can you please see if you can recreate the problem or not?
It looks like you're getting a file status of 35, which is a file not found. If the file does not exist or if the ID that the program is running under doesn't have access to that file, when you open the file for INPUT you'll get this error.
Make sure the file exists.
I copied the contents of NewData.cbl into a new source file in a new project and it compiled without errors. However, will "hello" be written into that file? I opened it after the program had executed and there was nothing there. The code in the screenshots above was written in COBOL for OS/390, which means that there's probably a syntax error. I stick to Visual COBOL for now... I compiled your program using Visual COBOL, but i still got unexpected resultat. Thanks in advance.
From the error message you are getting (as shown in your latest screen shot), it appears you may not have the environment set up correctly. Are you trying to execute the program at the command prompt?
I did this: New project > empty project. Then new > file > program in Visual Studios.
I build it and run it from the IDE. Have I missed something very fundamental?