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

Extract records from file for sum value 2 variables


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
selvaraja

New User


Joined: 04 Apr 2008
Posts: 17
Location: Maryland

PostPosted: Fri Dec 03, 2010 1:57 pm
Reply with quote

Hi,
I need to extract records from a file, where sum value of two variables is greater than 50.
Eg: file
10 15
15 13
25 35
45 45

Expected result :
25 35
45 45

Can anybody help me on this?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Dec 04, 2010 12:28 am
Reply with quote

selva,

The following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT    DD SYSOUT=*                             
//SORTIN    DD *                                   
----+----1----+----2----+----3----+----4----+----5--
10 15                                               
15 13                                               
25 35                                               
45 45                                               
//SORTOUT   DD SYSOUT=*                             
//SYSIN     DD *                                   
  SORT FIELDS=COPY                                 
  INREC OVERLAY=(81:1,2,ZD,ADD,4,2,ZD,M11,LENGTH=3)
  OUTFIL BUILD=(1,80),INCLUDE=(81,3,ZD,GT,50)       
//* 
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top