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
 
Sort in cobol - no record in out put file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Sort in cobol - no record in out put file
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    Post subject: Reply to: Sort in cobol - no record in out put file
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    Post subject: Re: Reply to: Sort in cobol - no record in out put file
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Jun 05, 2008 3:18 pm    Post subject: Re: Reply to: Sort in cobol - no record in out put file
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

Site Director


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

PostPosted: Thu Jun 05, 2008 9:49 pm    Post subject:
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    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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 0 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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