Getting IGZ0026W message for COBOL Sort program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Getting IGZ0026W message for COBOL Sort program

Postby magesh123 » Sat Jul 09, 2011 11:41 pm

Hi,
I am using the below COBOL code for sorting the input file and storing the output into output file.

Program:
FILE-CONTROL.                         
     SELECT IFILE ASSIGN TO AS-DD1.   
     SELECT WORKFILE ASSIGN TO AS-DD2.
     SELECT OFILE ASSIGN TO AS-DD3.   
DATA DIVISION.                         
FILE SECTION.                         
FD IFILE.                             
01 I-REC.                             
     02 I-EMPNO PIC 9(3).             
     02 I-FILLER PIC X.               
     02 I-EMPNAME PIC A(9).           
     02 FILLER PIC X(67).             
SD WORKFILE.                           
01 W-REC.                             
     02 W-EMPNO PIC 9(3).             
     02 W-FILLER PIC X.               
     02 W-EMPNAME PIC A(9).                       
     02 FILLER PIC X(67).                         
FD OFILE.                                         
01 O-REC.                                         
     02 O-EMPNO PIC 9(3).                         
     02 O-FILLER PIC X.                           
     02 O-EMPNAME PIC A(9).                       
     02 FILLER PIC X(67).                         
PROCEDURE DIVISION.                               
MAINP.                                           
     SORT WORKFILE ON ASCENDING KEY W-EMPNO USING
     IFILE GIVING OFILE.                         
     STOP RUN.   


When i compile and run the above program, it execute successfully. But i am getting the below warning message after running the program and i dont get the expected
output for the above program.

Error Message:
IGZ0026W The SORT-RETURN special register was never referenced, but the current content indicated the sort or merge
operation in program PGM1 on line number 31 was unsuccessful.

Input dataset:
123456789    --> cols
006 GURU 
004 TARA 
001 ARUL 
Please help me to troubleshoot the problem.

Thanks in Advance,
Magesh.
magesh123
 
Posts: 13
Joined: Fri Apr 15, 2011 11:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting IGZ0026W message for COBOL Sort program

 

Re: Getting IGZ0026W message for COBOL Sort program

Postby MrSpock » Sat Jul 09, 2011 11:49 pm

I'm not sure a sort workfile can be defined as a VSAM dataset.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Getting IGZ0026W message for COBOL Sort program

Postby magesh123 » Sat Jul 09, 2011 11:55 pm

Thanks for the information. I have also tried for sequential dataset and i am getting the same problem.

I found the below reason for the warning message IGZ0026W.

IGZ0026W The SORT-RETURN special register was never referenced, but the current content indicated the sort or merge operation in program program-name on line number line-number was unsuccessful.
Explanation: The COBOL source does not contain any references to the sort-return register. The compiler generates a test after each sort or merge verb. A nonzero return code has been passed back to the program by Sort/Merge.

Programmer Response: Determine why the Sort/Merge was unsuccessful and fix the problem. Possible reasons why the Sort/Merge was unsuccessful include:
There was an error detected by DFSORT. See the DFSORT messages for the reason for the error.
The SORT-RETURN special register was set to a non-zero value by the application program while in an input procedure or an output procedure.

System Action: No system action was taken.
magesh123
 
Posts: 13
Joined: Fri Apr 15, 2011 11:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting IGZ0026W message for COBOL Sort program

Postby Robert Sample » Sun Jul 10, 2011 12:01 am

Why do you find it so hard to do
PROCEDURE DIVISION.                               
MAINP.                                           
     SORT WORKFILE ON ASCENDING KEY W-EMPNO USING
     IFILE GIVING OFILE.                         
     DISPLAY SORT-RETURN.
     STOP RUN.
and find out what SORT is trying to tell you?

For that matter, were there not messages output from the SORT in your job?
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Getting IGZ0026W message for COBOL Sort program

Postby magesh123 » Sun Jul 10, 2011 12:29 am

Now i am getting return code as 0020 in sysout.
magesh123
 
Posts: 13
Joined: Fri Apr 15, 2011 11:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting IGZ0026W message for COBOL Sort program

Postby magesh123 » Sun Jul 10, 2011 12:43 am

If i include the below SYSOUT DD statement in RUN JCL, it works fine. Thank you all for your immediate response.
//SYSOUT DD SYSOUT=*
magesh123
 
Posts: 13
Joined: Fri Apr 15, 2011 11:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting IGZ0026W message for COBOL Sort program

Postby Robert Sample » Sun Jul 10, 2011 12:43 am

From what I can see, it looks like return code 20 means the sort message data set is missing. What does your JCL look like?
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Getting IGZ0026W message for COBOL Sort program

Postby magesh123 » Sun Jul 10, 2011 1:12 am

//STEP1 EXEC PGM=load module of Compiled program
//STEPLIB DD DSN=Load module library,DISP=SHR
//DD1 DD DSN=Sort input dataset,DISP=SHR
//DD2 DD DSN=Sort work file dataset,DISP=SHR
//DD3 DD DSN=Output dataset,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*

Note: I was missing SYSOUT DD statement.
magesh123
 
Posts: 13
Joined: Fri Apr 15, 2011 11:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting IGZ0026W message for COBOL Sort program

Postby Robert Sample » Sun Jul 10, 2011 1:35 am

Well, did it work with the missing SYSOUT statement?
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Getting IGZ0026W message for COBOL Sort program

Postby BillyBoyo » Sun Jul 10, 2011 4:58 am

magesh123 wrote:If i include the below SYSOUT DD statement in RUN JCL, it works fine. Thank you all for your immediate response.
//SYSOUT DD SYSOUT=*


This post was at the same time as your spot, Robert, so answering your last question before it was asked.

Magesh123,

Why are you doing the sort in a Cobol program, instead of, well, using the sort?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post