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

Regarding SORT


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 463

PostPosted: Tue Jan 17, 2006 5:42 pm
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 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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top