Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JMP0311I-U Missing Allocation. File=Sysin etc....Error

Status
Not open for further replies.

scottmitchell

Programmer
Sep 7, 2002
11
US
I'm new to Cobol, trying to figure it out...I'm getting the afore mentioned error when I run my program (compiles and links fine, but this error on execution). I have an input file, but I'm not sure how to use it, what format it should be in, etc. Right now I typed it up in Notepad, saved it without a file extension and have it named exactly as its named in the program.

Any suggestions? Any help would be greatly appreciated.
 
Try this.

Create "afile.txt" using Notepad and enter a few lines of 12 characters each.

Then, modify your COBOL program to specify the following:

SELECT afile
ASSIGN "afile.txt"
ORGANIZATION LINE SEQUENTIAL.

FD afile.
01 afile-rec PIC X(12).

Let us know how you are progressing.

Dimandja
 
Damandja,

Thanks for your comment. I tried what you suggested, and got the same error. So I proceeded to change the output file line from <i>assign to sysout</i> to something like what you suggested, ' assign &quot;ouput.txt&quot; ' . I then got a new run-time error: 'jmp0310I-U OPEN ERROR. FILE=AFILE.TXT. 'NON-FILE'. PGM=ATEXT ADR=0040120F'

I did create afile.txt ahead of time with one line less than 12 characters.

Suggestions?
 
Damandja,

Scratch that last post from me. I had a filename wrong, so what you suggested did work. However, I did have to change the line &quot;assign to sysout&quot; to assign &quot;output.txt&quot;. Anyway, I don't know what the deal is there. gave me an error about &quot;sysout&quot; not being valid. Do you know why that is?

Anyway, my prog works now, thanks to you!

Thanks a heap!

Scott
 
Scott,

I have not used 'SYSOUT' in years, but it looks like your program is trying to find a file of the name SYSOUT, instead of the file (printer?) associated with SYSOUT in a JCL.

Dimandja
 
Hi Mitchell

The error message means that your file doesn't exist in the folder where you're running your application.

Try to save the file on the execution folder (i believe DEBUG folder).
You can also try to set a FILE STATUS STATUS-REC in the SELECT ..... ASSIGN TO.....

In the WS-S put a field
01 STATUS-REC PIC XX.

PROCEDURE DIVISION.
OPEN-FILE.
OPEN INPUT AFILE
IF STATUS-REC = &quot;35&quot;
DISPLAY &quot;File Not Found!&quot;
END-IF

then you can decide to open output a new file or verify the reasons why the file is missing.

Hope in this help.

Gianni
 
To All:

I got the problem resolved, thanks to your help! I appreciate it very much!

Sincerely,

Scott M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top