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

Error message in FASTSRT compiler option


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

New User


Joined: 30 Apr 2007
Posts: 7
Location: pune

PostPosted: Tue Jun 19, 2007 8:48 pm
Reply with quote

hi,

i am running a sort program in COBOL but in compiler i am getting a message:

SORT SORT-FILE ON ASCENDING KEY W-STUDENTENTENTID
USING STUDENT
GIVING FRESULT.

File "STUDENT" in the "USING" phrase of the "SORT" statement was accepted as being eligibile for the FASTSRT compiler option.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 19, 2007 11:35 pm
Reply with quote

Hello,

When you post a message, the message number should be posted with it.

I believe what you received is only informational and not an error.
Back to top
View user's profile Send private message
sh_moni
Currently Banned

New User


Joined: 30 Apr 2007
Posts: 7
Location: pune

PostPosted: Wed Jun 20, 2007 5:47 pm
Reply with quote

My cobol Code :

Code:
IDENTIFICATION DIVISION.               
PROGRAM-ID. ASSIGN17.                 
ENVIRONMENT DIVISION.                 
INPUT-OUTPUT SECTION.                 
FILE-CONTROL.                         
       SELECT STUDENT ASSIGN TO DD2.   
       SELECT SORT-FILE ASSIGN TO DD3.
       SELECT FRESULT ASSIGN TO DD4.   
DATA DIVISION.                         
FILE SECTION.                         
FD STUDENT                             
    RECORDING MODE IS F               
    RECORD CONTAINS 80 CHARACTERS.     
01 STUDENTDETAILS.                     
    02  STUDENTID PIC 9(7).           
    02  STUDENTNAME.                   
       03 SURNAME       PIC X(8).     
       03 INITIALS      PIC XX.       
    02  DATEOFBIRTH.                   
       03 YOBIRTH       PIC 9(4).     
       03 MOBIRTH       PIC 9(2).     
       03 DOBIRTH       PIC 9(2).     
    02  COURSECODE      PIC X(2).     
    02  GRANT           PIC 9(2).     
    02  GENDER          PIC X.         
    02                  PIC X(50).     
SD SORT-FILE.                         
01 SORT-DETAILS.                       
    02  W-STUDENTID       PIC 9(7).   
    02                    PIC X(73).   
FD FRESULT                             
    RECORDING MODE IS F               
    RECORD CONTAINS 80 CHARACTERS.     
01 FINALDETAILS.                       
    02  F-STUDENTID PIC 9(7).         
    02              PIC X(73).         
 01 WS-WORK-AREAS.                                     
     05 ARE-THERE-MORE-RECORDS   PIC X(3) VALUE 'YES'.
 PROCEDURE DIVISION.                                   
 BEGIN.                                               
     OPEN INPUT  STUDENT.                             
     OPEN OUTPUT FRESULT.                             
     PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO'       
     READ STUDENT                                     
        AT END                                         
           MOVE 'NO' TO ARE-THERE-MORE-RECORDS         
        NOT AT END                                     
           PERFORM SORT-OF-FILES                       
     END-READ                                         
     END-PERFORM.                                           
     CLOSE STUDENT.                                   
     CLOSE FRESULT.                                   
     STOP RUN.                                         
 SORT-OF-FILES.                                         
     MOVE STUDENTDETAILS TO SORT-DETAILS                       
     SORT SORT-FILE ON ASCENDING KEY W-STUDENTID       
        USING STUDENT                                 
        GIVING FRESULT.                             


The error message I am getting For This is as below.

A logic error occurred. Neither FILE STATUS nor a declarative was specified for at relative location X'071A'. The status code was 41.
From compile unit ASSIGN17 at entry point ASSIGN17 at compile unit offset +00000 at address 09300BFA.


What i understand is the program is failing at the SORT step that's why it is giving file status 41 when next time i am trying to run the program.But can somebody enlighten me about the Logic error as i dont find anything wrong in the code.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 20, 2007 5:57 pm
Reply with quote

Hello,

When you post an error, please post your jcl and the diagnostic info for the compile and the run - do not type them into the post, copy/paste them.

This problem is caused by trying to use files in the sort that are already open. You cannot name files in SORT that are already in use in the code elsewhere.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 20, 2007 5:58 pm
Reply with quote

FS 41 is opening a file already open. With the sort using, you should not open the file, sort will do it.
Try it this way:
Code:
BEGIN.                                               
     SORT SORT-FILE ON ASCENDING KEY W-STUDENTID       
        USING STUDENT                                 
        GIVING FRESULT.                             
     STOP RUN.                                         

By the way, since you are doing nothing to the records, why COBOL, why not just sort utility?
Back to top
View user's profile Send private message
sh_moni
Currently Banned

New User


Joined: 30 Apr 2007
Posts: 7
Location: pune

PostPosted: Wed Jun 20, 2007 9:40 pm
Reply with quote

Many thanks William. icon_razz.gif
Sorry Dick I am quite new both to mainframes and this forum so please ignore my faults.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 21, 2007 12:29 am
Reply with quote

Hi Manoj,

Not to worry - we're here to help with both the mainframe and the forum:)
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 Error to read log with rexx CLIST & REXX 11
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top