IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Abend S000 U4038


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ankoo

New User


Joined: 12 Jun 2010
Posts: 31
Location: India

PostPosted: Tue Oct 12, 2010 12:58 pm
Reply with quote

Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. STU.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT STU-DETAIL1 ASSIGN TO FLAT1.
    SELECT STU-DETAIL2 ASSIGN TO FLAT2.
    SELECT STU-DETAIL0 ASSIGN TO FLAT3.
DATA DIVISION.
FILE SECTION.
FD  STU-DETAIL1.
01  STU-DETAIL1-REC.
    05  NAME                     PIC X(10).
    05  ROLLNO                   PIC 9(4).
    05  DEPT                     PIC X(4).
    05  FILLER                   PIC X(62).
FD  STU-DETAIL2.
01  STU-DETAIL2-REC.
    05  NAME2                    PIC X(10).
    05  ROLLNO2                  PIC 9(4).
    05  VEHNO                    PIC X(2).
    05  FILLER                   PIC X(64).
FD  STU-DETAIL0.
01  STU-DETAIL0-REC.
    05  NAME0                    PIC X(10).
    05  ROLLNO0                  PIC 9(4).
    05  DEPT0                    PIC X(4).
    05  VEHNO0                   PIC X(2).
    05  FILLER                   PIC X(60).
PROCEDURE DIVISION.
0000-MAIN-PARA.
     PERFORM 1000-INITIALIZATION.
     PERFORM 2000-PROCESS.
      PERFORM 3000-CLOSE.
      PERFORM 9999-EXIT.
 1000-INITIALIZATION.
      OPEN INPUT STU-DETAIL1.
      OPEN INPUT STU-DETAIL2.
      OPEN OUTPUT STU-DETAIL0.
 2000-PROCESS.
      READ STU-DETAIL1
      READ STU-DETAIL2
      IF ROLLNO = ROLLNO2
      MOVE NAME TO NAME0
      MOVE ROLLNO TO ROLLNO0
      MOVE DEPT TO DEPT0
      MOVE VEHNO TO VEHNO0
      WRITE STU-DETAIL0-REC.
      END-IF.
 3000-CLOSE.
      CLOSE STU-DETAIL1.
      CLOSE STU-DETAIL2.
      CLOSE STU-DETAIL0.
 9999-EXIT.
      STOP RUN.

I am using the above cobol code, but getting an abend saying
Code:
********************************* TOP OF DATA **********************************
IGZ0035S There was an unsuccessful OPEN or CLOSE of file FLAT1 in program STU at
         FILE STATUS nor an ERROR declarative were specified. The status code wa
         From compile unit STU at entry point STU at compile unit offset +000004
         address 1CD009BE.
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
Joel.B

New User


Joined: 13 Oct 2007
Posts: 5
Location: India

PostPosted: Tue Oct 12, 2010 1:02 pm
Reply with quote

Check to make sure there is a ddname defined for the indicated file.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Oct 12, 2010 1:16 pm
Reply with quote

ibmmainframes.com/viewtopic.php?t=51649&start=15

Already mentioned in your previous post : you are not fit for IT.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 12, 2010 4:09 pm
Reply with quote

There is a manual link at the top of the page. Click on it, find the COBOL Language Reference manual, and read it -- cover to cover -- then go back and rewrite your program to include file status clauses for every file. Then put code in to actually look at the file status codes when you do an open, read, write, or anything else with a file.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Oct 12, 2010 5:15 pm
Reply with quote

You seem to be attempting to write/learn COBOL and JCL on the fly.

Seriously - my rec is that you take an actual class (or 2 (or 3 ...)) with a human instructor.

Your errors above (both posts) are very elemental. Linking the file name in COBOL to the dataset in the JCL is covered early in any intro class.

This may be too complicated to learn otherwise.

Good luck.
Back to top
View user's profile Send private message
ankoo

New User


Joined: 12 Jun 2010
Posts: 31
Location: India

PostPosted: Wed Oct 13, 2010 10:54 am
Reply with quote

I used File Status in the cobol code like this
Code:
SELECT STU-DETAIL1 ASSIGN TO FLAT1
       STATUS IS FS1.
SELECT STU-DETAIL2 ASSIGN TO FLAT2
       STATUS IS FS2.
SELECT STU-DETAIL0 ASSIGN TO FLAT3
       STATUS IS FS3.

Now after the runjcl MaxCC=0 is coming, but after using the LABEL RECORDS as below MAXCC=12 is coming
Code:
FD  STU-DETAIL1.
    LABEL RECORDS ARE STANDARD
--1----+----2----+----3----+----4----+----5----+
    LABEL RECORDS ARE STANDARD
    RECORDING MODE IS F
    BLOCK CONTAINS 0 RECORDS.
01  STU-DETAIL1-REC.
    05  NAME                     PIC X(10).
    05  ROLLNO                   PIC 9(4).
    05  DEPT                     PIC X(4).
    05  FILLER                   PIC X(62).
FD  STU-DETAIL2.
    LABEL RECORDS ARE STANDARD
    RECORDING MODE IS F
    BLOCK CONTAINS 0 RECORDS.
01  STU-DETAIL2-REC.
    05  NAME2                    PIC X(10).
    05  ROLLNO2                  PIC 9(4).
    05  VEHNO                    PIC X(2).


and the messsage in spool is
Code:
15  IGYDS1089-S   "LABEL" was invalid.  Scanning was resumed at the next are was resumed at the next area "A" item, level-number, or the start of the next clause.
Back to top
View user's profile Send private message
ankoo

New User


Joined: 12 Jun 2010
Posts: 31
Location: India

PostPosted: Wed Oct 13, 2010 11:02 am
Reply with quote

And look who's new to the post of GOD "PeterHolland!!!!"
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Need to get an DLI abend like U0200 IMS DB/DC 2
Search our Forums:

Back to Top