Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Identify the value if the SUM of the amount is not zero

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
PORYES

New User


Joined: 04 Apr 2007
Posts: 38
Location: Chennai

PostPosted: Sun May 10, 2020 12:46 am    Post subject: Identify the value if the SUM of the amount is not zero
Reply with quote

Hi -

My input file hasthe below values.
----+----1----+----2
********************
ID AMT
1020 +10
1020 -10
1021 +5
1021 -5
1021 -8
1021 -1
1035 -5
1035 +5
1035 -2
1035 +2

My requirement is to check which ID values are NOT net Zero.

Eg: If we check the ID: 1020 and sum the amount the value should be zero.

For ID: 1021, Sum of the amounts are not Zero.
If the values are not zero, then display the ID.

Can anyone please help.
Back to top
View user's profile Send private message

Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Sun May 10, 2020 12:51 am    Post subject:
Reply with quote

Help yourself and use code tags when providing data/code. icon_exclaim.gif
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Sun May 10, 2020 1:15 am    Post subject:
Reply with quote

Code:
//EXPERT   EXEC PGM=SORT                       
//SORTIN   DD *                               
1020 +10                                       
1020 -10                                       
1021 +5                                       
1021 -5                                       
1021 -8                                       
1021 -1                                       
1035 -5                                       
1035 +5                                       
1035 -2                                       
1035 +2                                       
/*                                             
//SYSOUT   DD SYSOUT=*                         
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  INREC IFTHEN=(WHEN=INIT,                     
    OVERLAY=(41:6,8,SFF,TO=ZD,LENGTH=8))       
  SORT FIELDS=(1,4,ZD,A)                       
  SUM FIELDS=(41,8,ZD)                         
  OUTFIL FNAMES=(SORTOUT),                     
    INCLUDE=(41,8,ZD,NE,+0),                   
    REMOVECC,                                 
    BUILD=(1,4,X,41,8,ZD,M25,SIGNS=(+,-),LENGTH=9)         
  END                                         
/*

Output:
Code:
1021        -9
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2419
Location: Hampshire, UK

PostPosted: Sun May 10, 2020 1:23 am    Post subject: Reply to: Identify the value if the SUM of the amount is not zero
Reply with quote

You have been asked on several occasionsto use the code tags and consistently fail to do so. This is disrespectful to those who help and also to other browsing the forum for information. Please use the code tags in future.
Back to top
View user's profile Send private message
PORYES

New User


Joined: 04 Apr 2007
Posts: 38
Location: Chennai

PostPosted: Sun May 10, 2020 7:13 pm    Post subject: Reply to: Identify the value if the SUM of the amount is not zero
Reply with quote

Thank you so much Joerg.

I Apologize and will make sure to add code tags for future posts.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Identify the count from two diffrent ... UmashankarSubramani DFSORT/ICETOOL 19 Sat Jul 11, 2020 4:35 am
No new posts Identify who, from where, sign on CIC... Weilin Wen CICS 1 Thu May 09, 2019 1:23 pm
No new posts REXX identify the last/latest created... sivatechdrive CLIST & REXX 7 Thu Jan 24, 2019 12:15 pm
No new posts Formating of Amount field in CLIST be... Anil Kumar Prajapati CLIST & REXX 9 Fri Aug 03, 2018 6:34 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 9 Wed Feb 21, 2018 7:21 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us