Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to eliminate records from operation of two fields

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

New User


Joined: 08 Aug 2006
Posts: 10
Location: FRANCE

PostPosted: Tue Dec 23, 2014 4:42 pm    Post subject: how to eliminate records from operation of two fields
Reply with quote

I want to eliminate records after an arithmetic operation (a sum) of two fields resulting as zero.

On a record M1 field + M2 field give zero.

Amount M1 : position 1 PIC 9(10)
Amount M2 : position 12 PIC 9(10)

Regards
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Dec 23, 2014 5:24 pm    Post subject: Reply to: how to eliminate records from operation of two fie
Reply with quote

So you use OUTFIL with OMIT=.
Back to top
View user's profile Send private message
PUMA

New User


Joined: 08 Aug 2006
Posts: 10
Location: FRANCE

PostPosted: Tue Dec 23, 2014 8:27 pm    Post subject:
Reply with quote

How to code the OMIT statement with the SUM ?
Regards
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Tue Dec 23, 2014 8:48 pm    Post subject: Reply to: how to eliminate records from operation of two fie
Reply with quote

You must create an additional field with the sum
and use omit on that
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Tue Dec 23, 2014 9:08 pm    Post subject:
Reply with quote

Sample syntax

Code:

//SORTIN   DD *
0000 0
0001 0
0000 0
0000 0
0000 0
0000 0
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL FNAMES=SORTOUT,BUILD=(1:1,10,11:1,4,ZD,ADD,6,1,ZD,
  TO=ZD,LENGTH=4),
  INCLUDE=(1,4,ZD,NE,0,OR,6,1,ZD,NE,0)


Output
Code:

0001 0    0001
Back to top
View user's profile Send private message
PUMA

New User


Joined: 08 Aug 2006
Posts: 10
Location: FRANCE

PostPosted: Fri Dec 26, 2014 4:10 pm    Post subject:
Reply with quote

Hi All
Many thinks for your help.
I just investigated more on the DFSORT book !!!!

Regards


Code:

My INPUT :

000001 000000020é 000000040è 11111111111111BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC           
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000002000000000040001111111111111122222222222222222233333333333333330000000000
-------------------------------------------------------------------------------------- 
000002 000000030é 000000030è 22222222222222BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC           
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000003000000000030002222222222222222222222222222222233333333333333330000000000
-------------------------------------------------------------------------------------- 
000003 000000020é 000000040è 33333333333333BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC           
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000002000000000040003333333333333322222222222222222233333333333333330000000000
-------------------------------------------------------------------------------------- 
000004 000000010é 000000010è 44444444444444BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC           
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000001000000000010004444444444444422222222222222222233333333333333330000000000
-------------------------------------------------------------------------------------- 
000005 000000020é 000000040è 55555555555555BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC           
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000002000000000040005555555555555522222222222222222233333333333333330000000000
       00000002000000000040005555555555555522222222222222222233333333333333330000000000

SORT FIELDS=COPY                                 
INREC  FIELDS=(1,70,(1,10,ZD,ADD,12,10,ZD),TO=ZD,
       LENGTH=10)                               
OUTFIL OMIT=(71,10,ZD,EQ,+0),OUTREC=(1,70,10X)


My Output :

000001 000000020é 000000040è 11111111111111BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC         
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000002000000000040001111111111111122222222222222222233333333333333330000000000
--------------------------------------------------------------------------------------
000002 000000020é 000000040è 33333333333333BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC         
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000002000000000040003333333333333322222222222222222233333333333333330000000000
--------------------------------------------------------------------------------------
000003 000000020é 000000040è 55555555555555BBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC         
       FFFFFFFFFC4FFFFFFFFFD4FFFFFFFFFFFFFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4444444444
       00000002000000000040005555555555555522222222222222222233333333333333330000000000
--------------------------------------------------------------------------------------   
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

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