Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
Raja12752

New User


Joined: 18 Jul 2006
Posts: 17

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
References
PostPosted: Mon May 05, 2008 10:39 am    Post subject: Re: SORT to extract data from production Reply with quote

Moved: Mon May 05, 2008 11:40 am by superk From JCL to DFSORT/ICETOOL
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 6756
Location: 221 B Baker St

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: 17

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

Global Moderator


Joined: 23 Nov 2006
Posts: 6756
Location: 221 B Baker St

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: 17

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

DFSORT Developer


Joined: 07 Dec 2007
Posts: 212
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1