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

Sort in cobol - no record in out put file


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

New User


Joined: 21 Nov 2005
Posts: 35
Location: chennai

PostPosted: Thu Jun 05, 2008 9:09 am
Reply with quote

SORT FIELDS=(0001,0009,CH,A)
RECORD TYPE=F,LENGTH=(000011,,)
WER161B ALTERNATE PARM USED
WER276B SYSDIAG= 383216, 5459744, 5459744, 7362502
WER164B 12,968K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 160K BYTES RESERVE REQUESTED, 12,348K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER410B 11,780K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 11,780K BYTES USED
WER036B G=176755,B=1637,BIAS=99
WER045C END SORT PHASE
WER055I INSERT 2513960, DELETE 2513960
WER418I DATASPACE(S) AND/OR ZSPACE USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B TOTAL OF 0 EXCP'S ISSUED FOR SORTING
WER246I FILESIZE 27,653,560 BYTES
WER054I RCD IN 0, OUT 0
Back to top
View user's profile Send private message
rskumar

New User


Joined: 21 Nov 2005
Posts: 35
Location: chennai

PostPosted: Thu Jun 05, 2008 9:11 am
Reply with quote

Also here is my cobol program:

OPEN INPUT PENDIN.
OPEN OUTPUT C50.
OPEN OUTPUT D20.
MOVE 'N' TO WS-MATCH-RECORD
WS-EOF-FILE.


PERFORM P1000-READ-PEND UNTIL EOF-FILE-YES.

CLOSE D20.
PERFORM SORT-PARA.
CLOSE PENDIN.


SORT-PARA.
SORT WORKFILE ON ASCENDING KEY SD-DTL-EC-ID
USING D20 GIVING
D20SRT.

***Please let me know where could be the error. Im brooding over this for the past few hours*** Thanks
Back to top
View user's profile Send private message
khandelwal

New User


Joined: 13 May 2008
Posts: 4
Location: mumbai

PostPosted: Thu Jun 05, 2008 1:50 pm
Reply with quote

rskumar wrote:
Also here is my cobol program:



CLOSE D20.
PERFORM SORT-PARA.
CLOSE PENDIN.


***Please let me know where could be the error. Im brooding over this for the past few hours*** Thanks


you are closing the o/p file before sorting........i think this is the reason there is no record in the o/p file.
jst put close stmt after perform stmt.
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Jun 05, 2008 2:20 pm
Reply with quote

The file which needs to be sorted has to be closed before sorting ...

kumar can you post the exact JCL with the sortfile, input file decls ... and the exact COBOL code ...
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jun 05, 2008 3:18 pm
Reply with quote

rskumar wrote:
Also here is my cobol program
This scrap of code is crap....
Quote:
***Please let me know where could be the error. Im brooding over this for the past few hours*** Thanks
Simple answer, there are no records in the file D20. Figure out why, and you will solve your problem.
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 05, 2008 9:49 pm
Reply with quote

Hello,

Most likely P1000-READ-PEND has some coding error(s) or the PENDIN file is empty.

Once you find out why there are no records in the sort-input file, you should also change the program to use INPUT PROCEDURE and possibly OUTPUT PROCEDURE.

Specifying both USING and GIVING is the possibly worst way to use the internal sort.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top