Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Regarding SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
vrakeshmbt

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Tue Jan 17, 2006 11:43 am    Post subject: Regarding SORT
Reply with quote

IDENTIFICATION DIVISION.
PROGRAM-ID. R.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN TO FILE1.
SELECT FILE2 ASSIGN TO FILE2.
SELECT WORKFILE ASSIGN TO WORKFILE.
DATA DIVISION.
FILE SECTION.
FD FILE1 LABEL RECORDS ARE STANDARD.
01 FILE1REC.
05 EMPID1 PIC 9(5).
05 EMPNAME1 PIC X(9).
FD FILE2 LABEL RECORDS ARE STANDARD.
01 FILE2REC.
05 EMPID2 PIC 9(5).
05 EMPNAME2 PIC X(9).
SD WORKFILE.
01 WORKREC.
05 EMPIDW PIC 9(5).
05 EMPNAMEW PIC X(9).
PROCEDURE DIVISION.
SORT WORKFILE ASCENDING KEY EMPIDW USING FILE1 GIVING FILE2.
STOP RUN.


The below given is the JCL for the above COBOL code...

//JOBFILE1 JOB (A),' ',NOTIFY=&SYSUID,
// MSGCLASS=1
//STEP010 EXEC PGM=IEFBR14
//FILE2 DD DSN=BPMAIN.VRAKESH.APPL.FILE2,DISP=(OLD,DELETE)
//STEP020 EXEC PGM=TESTY
//STEPLIB DD DSN=BPMAIN.VRAKESH.APPL.LOADLIB,DISP=SHR
//FILE1 DD DSN=BPMAIN.VRAKESH.APPL.FILE1,DISP=SHR
//FILE2 DD DSN=BPMAIN.VRAKESH.APPL.FILE2,DISP=(,CATLG),
// SPACE=(TRK,(1,1)),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=27920)
//WORKFILE DD DUMMY,
// SPACE=(TRK,(2,2)),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=27920)


But I am not getting the sorted output, The sorted file i.e FILE2 is empty after I run the JCL.

Can Anyone tell me is there any mistake in this coding?

BPMAIN.VRAKESH.APPL.FILE1 is existing with the same characteristics as specified for FILE2.
Back to top
View user's profile Send private message

Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Tue Jan 17, 2006 5:42 pm    Post subject: Re: Regarding SORT
Reply with quote

Hi,

Make following change and try it
From
Code:
//STEP020 EXEC PGM=TESTY


To
Code:
//STEP020 EXEC PGM=R


Hope this helps

Regards
Rupesh
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us