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
 

 

SORT to extract data from production

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Raja12752

New User


Joined: 18 Jul 2006
Posts: 28

PostPosted: Mon May 05, 2008 10:39 am    Post subject: SORT to extract data from production
Reply with quote

I am in a situation, wherein i need to extract data from production.
Please find in the below the sample data.


Name Department Marks
Sam physics 30
Sam maths 40
Sam chemistry 40
Sam english 40
Sam geography 40
Arun physics 10
Arun maths 20
Arun chemistry 30
Arun english 50
Arun geography 50
Arun history 50
Arun hindi 50
Imran english 50
Imran Maths 60
jose English 50


Here in the above example, i need to extract data [in blue] from production using either SORT or some other utlities.
[ extraction condition - Matching names, with highest marks ]
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: Mon May 05, 2008 12:14 pm    Post subject:
Reply with quote

Hello,

There is no blue in your post?

Post the output you want from that input.
Back to top
View user's profile Send private message
Raja12752

New User


Joined: 18 Jul 2006
Posts: 28

PostPosted: Mon May 05, 2008 12:51 pm    Post subject:
Reply with quote

Sam maths 40
Sam chemistry 40
Sam english 40
Sam geography 40

Arun english 50
Arun geography 50
Arun history 50
Arun hindi 50

Imran Maths 60

jose English 50


This is the output should be.
i.e. on basis of Name & Marks, need to get output for Highest marks.
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: Mon May 05, 2008 12:57 pm    Post subject:
Reply with quote

Hello again,

Forgot to ask icon_redface.gif

Are the name and subject fields variable length (as shown) or are they fixed length in the actual data?

Also, please post the recfm and lrecl of the files.
Back to top
View user's profile Send private message
Raja12752

New User


Joined: 18 Jul 2006
Posts: 28

PostPosted: Mon May 05, 2008 2:26 pm    Post subject:
Reply with quote

it is FB and consider LRECL = 80.

Thanks,
Raja.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon May 05, 2008 9:29 pm    Post subject: Reply to: SORT to extract data from production
Reply with quote

Assuming that the name is 10 bytes and the marks are 2 bytes which start at position 30 here is a DFSORT/ICETOOL JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6
SAM           PHYSICS        30                             
SAM           MATHS          40                             
SAM           CHEMISTRY      40                             
SAM           ENGLISH        40                             
SAM           GEOGRAPHY      40                             
ARUN          PHYSICS        10                             
ARUN          MATHS          20                             
ARUN          CHEMISTRY      30                             
ARUN          ENGLISH        50                             
ARUN          GEOGRAPHY      50                             
ARUN          HISTORY        50                             
ARUN          HINDI          50                             
IMRAN         ENGLISH        50                             
IMRAN         MATHS          60                             
JOSE          ENGLISH        50                             
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  SPLICE FROM(IN) TO(OUT) ON(1,10,CH) WITH(01,80) WITHALL -
  KEEPBASE KEEPNODUPS USING(CTL1)                           
//CTL1CNTL DD *                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:30,2))               
  SORT FIELDS=(1,10,CH,A,                                   
               81,2,CH,D)                                   
  OUTFIL FNAMES=OUT,BUILD=(01,80),                         
  INCLUDE=(81,2,ZD,EQ,30,2,ZD)                             
/*                                                         


Hope this helps...

Cheers
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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