MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort Records on subject and fetch first 3 records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Fri Sep 01, 2006 1:07 am    Post subject: Sort Records on subject and fetch first 3 records Reply with quote

I need to write a jcl which does sorting based on some fields suppose say it is subject I just need to sort those records based on the subjects and fetch fst three marks on descending order............
_________________
IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE.
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Sep 01, 2006 7:51 am    Post subject: Reply with quote

kingo,

Try this job .

Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                   
----+----1----+----2----+----3----+----4----+----5
MATHS          100                               
MATHS          020                               
MATHS          096                               
MATHS          082                               
MATHS          099                               
SCIENCE        082                               
SCIENCE        099                               
SCIENCE        027                               
PHYSICS        027                               
PHYSICS        097                               
PHYSICS        097                               
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                   
  SORT FIELDS=(01,10,CH,A,                       
               16,03,CH,D)                       
  SUM FIELDS=NONE                                 
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,10)) 
  OUTFIL INCLUDE=(81,8,ZD,LE,3),                 
  OUTREC=(01,80)                                 
/*


Hope this helps...

Cheers

Kolusu

PS: Please choose approriate titles for your posts. A simple title "HI" is not going to help. I changed the title to reflect the requirement.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group