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

problem with cobol sort


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

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Tue Sep 29, 2009 6:57 pm
Reply with quote

Hi,

I am doing a cobol sort program.

The sort statement is :-

SORT SORT-NASCCBF-FILE ON ASCENDING KEY SD-CBF-GROUP-NO
SD-CBF-ALPHA-PREFIX
SD-CBF-PARPLAN-NO
SD-CBF-PARPLAN-NAME
SD-CBF-BCDELIVERY-MODEL
USING NASCCBF-FILE
OUTPUT PROCEDURE IS 3000-ARRAY-PROCESS-PARA
THRU 3000-EXIT.
IF SORT-RETURN NOT EQUAL TO ZERO
DISPLAY 'ABNORMAL SORT , RC = ' SORT-RETURN
END-IF.

File control :-

1. Input file
SELECT NASCCBF-FILE ASSIGN TO NASCCBFF
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL
FILE STATUS IS NASCCBFF-STATUS.

2. sort file :-
SELECT SORT-NASCCBF-FILE ASSIGN TO UT-S-SORTWK01.

FD ENTRY :-

1. INPUT FILE -
FD NASCCBF-FILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS NASCCBF-REC.
01 NASCCBF-REC.
05 CBF-GROUP-NO PIC X(16).
05 CBF-ALPHA-PREFIX PIC X(13).
05 CBF-PARPLAN-NO PIC X(11).
05 CBF-PARPLAN-NAME PIC X(22).
05 CBF-BCDELIVERY-MODEL PIC X(29).
05 CBF-PCPM PIC X(11).
05 CBF-EFFECTIVE-DATE PIC X(15).
05 CBF-TERM-DATE PIC X(08).

SORT FILE :-
SD SORT-NASCCBF-FILE
DATA RECORD IS SORT-NASCCBF-REC.

01 SORT-NASCCBF-REC.
05 SD-NASCCBF-KEY.
10 SD-CBF-GROUP-NO PIC X(16).
10 SD-CBF-ALPHA-PREFIX PIC X(13).
10 SD-CBF-PARPLAN-NO PIC X(11).
10 SD-CBF-PARPLAN-NAME PIC X(22).
10 SD-CBF-BCDELIVERY-MODEL PIC X(29).
05 SD-CBF-PCPM PIC X(11).
05 SD-CBF-EFFECTIVE-DATE PIC X(15).
05 SD-CBF-TERM-DATE PIC X(08).

After the sort is encountered I am getting an error in sort with sort return code = 20.
From ibm manuals the error stands for :-
Invalid comparison between two data types in SELECT

Please help me identify what exactly is the issue.

Thanks,
Bijoy
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Sep 29, 2009 7:15 pm
Reply with quote

You have
Code:
SELECT SORT-NASCCBF-FILE ASSIGN TO UT-S-SORTWK01.
and the COBOL Programming Guide manual (link at the top of the page) says
Quote:
1.12.8 Defining sort and merge data sets

To use DFSORT under z/OS, code DD statements in the runtime JCL to describe the necessary data sets that are listed below.

Sort or merge
work Define a minimum of three data sets: SORTWK01, SORTWK02, SORTWK03, . . ., SORTWKnn (where nn is 99 or less). These data sets cannot be in the HFS.

SYSOUT
Define for sort diagnostic messages, unless you change the data-set name. (Change the name using either the MSGDDN keyword of the OPTION control statement in the SORT-CONTROL data set, or using the SORT-MESSAGE special register.)

SORTCKPT
Define if the sort or merge is to take checkpoints.

Input and
output Define input and output data sets, if any.
Note that the SORTWK01, 2, ... files are separate from and not the same as your USING and GIVING files. Your error is probably due to using a sort work file name instead of a sort file name in the ASSIGN.
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Tue Sep 29, 2009 7:45 pm
Reply with quote

I even tried to do it that way..but still not working
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Tue Sep 29, 2009 7:50 pm
Reply with quote

'Invalid comparison between two data types in SELECT '

--- What does this mean exactly...Pls help???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Sep 29, 2009 8:04 pm
Reply with quote

Quote:
I even tried to do it that way..but still not working
So, what did you change your ASSIGN to look like? What does the DD statement in your JCL look like for the file you assigned? Just posting that you changed it and saying it didn't work doesn't give us anything to go from -- without knowing exactly what you are attempting, any advice we give you could be very wrong. Let's see the revised ASSIGN statement and the associated DD statement in your JCL. Use BBcode for this post, too -- it makes the items more readable.

And waiting five minutes before asking again is pretty rude, IMHO, since the people who respond on this forum do tend to have other jobs that pay them to work, not answer your questions immediately.
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 Sep 29, 2009 10:02 pm
Reply with quote

Hello,

Quote:
'Invalid comparison between two data types in SELECT '
What is the message id for this? What statement causes this error?

What other diagnostic information is generated in the problem run?

Quote:
I am getting an error in sort with sort return code = 20.
If i remember correctly, sort-return contains zero for a successful sort and 16 for a failure. . . Please post the link to where you found this:
Quote:
From ibm manuals the error stands for :-
Invalid comparison between two data types in SELECT
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top