Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
problem with cobol sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: problem with cobol sort
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 29, 2009 7:15 pm    Post subject:
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    Post subject: Reply to: problem with cobol sort
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    Post subject: Reply to: problem with cobol sort
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 29, 2009 8:04 pm    Post subject:
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

Site Director


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

PostPosted: Tue Sep 29, 2009 10:02 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us