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
 

 

Remove dups and perform math function.

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

New User


Joined: 08 Nov 2006
Posts: 15

PostPosted: Sat Nov 18, 2006 8:51 pm    Post subject: Remove dups and perform math function.
Reply with quote

Hi All,
i want to remove duplicate record but wanted to have some of fileds values to get added and substracted in output files

e.g.
input

Code:

12300 Rahul +100.00
12300 Rahul +060.00



Output1

Code:

12300 Rahul +160.00


Output2

Code:

12300 Rahul +040.00
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Nov 18, 2006 10:11 pm    Post subject:
Reply with quote

It's not clear what you want to do.

Do you only have two records as shown? Or do you have more than two records? If you have more than two records, do you have just two records with each key that you want to add and subtract? If you have more than two records per key, what do you want to add and subtract?
Please show a more complete example of the records in your input file and the records you expect for output.
Back to top
View user's profile Send private message
rahul_kolhe

New User


Joined: 08 Nov 2006
Posts: 15

PostPosted: Sat Nov 18, 2006 11:25 pm    Post subject: Re: Remove dups and perform math function.
Reply with quote

Frank,

Sorry, above one is not complete info. Please find below example

Input:
cols
1-5 7-15 16-23
12300 Rahul +100.00
12300 Rahul +060.00
12400 Frank +500.00
12400 Frank +250.00
12500 kolhe +200.00
12500 kolhe +200.00
12600 yeager +100.00

Output1:
12300 Rahul +160.00 ---> did addition
12400 Frank +750.00 ----> did addition
12500 kolhe +200.00 ----> as dups and do not have change invalues
12600 yeager +100.00 ----> only one

Output2:
12300 Rahul +040.00 ---> did substract
12400 Frank +250.00 ----> did substract
12500 kolhe +000.00 ----> as dups put zero's
12600 yeager +000.00 ----> as only one record


Is it possible thru DFSORT?

If any one output is possible then I am okay.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Nov 19, 2006 9:58 pm    Post subject:
Reply with quote

Based on what you've told me, I believe the following DFSORT/ICETOOL job will do what you want. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SELECT. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/23)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1 (FB/23)
//OUT2 DD DSN=...  output file2 (FB/23)
//TOOLIN   DD    *
SELECT FROM(IN) TO(T1) ON(1,23,CH) FIRST USING(CTL1)
SORT FROM(T1) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(25:SEQNUM,1,ZD,RESTART=(1,15),
    27:16,8,SFF,TO=ZD,LENGTH=5,
    33:27,5)
  OUTFIL FNAMES=T1,
    IFTHEN=(WHEN=(25,1,ZD,EQ,+2),
      OVERLAY=(33:27,5,ZD,MUL,-1,TO=ZD,LENGTH=5))
/*
//CTL2CNTL DD *
  SORT FIELDS=(1,15,CH,A)
  OPTION ZDPRINT
  SUM FIELDS=(25,1,ZD,27,5,ZD,33,5,ZD)
  OUTFIL FNAMES=OUT1,
    BUILD=(1,15,17:27,5,ZD,EDIT=(STTT.TT),SIGNS=(+,-))
  OUTFIL FNAMES=OUT2,
    IFTHEN=(WHEN=(25,1,ZD,EQ,+1),
      BUILD=(1,15,17:C'+000.00')),
    IFTHEN=(WHEN=NONE,
      BUILD=(1,15,17:33,5,ZD,EDIT=(STTT.TT),SIGNS=(+,-)))
/*
Back to top
View user's profile Send private message
rahul_kolhe

New User


Joined: 08 Nov 2006
Posts: 15

PostPosted: Mon Nov 20, 2006 7:51 pm    Post subject: Re: Remove dups and perform math function.
Reply with quote

Thank you.
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 Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am


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