MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Include records after Multiply

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Dec 13, 2007 12:50 pm    Post subject: Include records after Multiply Reply with quote

Hi All,

I have an Input file which has various amounts coming in .. I need to include records which satisfy the below criteria.

Input file :

-100
+001
-001
.
.
.
.
.


Amount ( shown above is in COMP-3 format ... 9(03)v9(02))

I need to write out the records which satisfy the below criteria.

if (amount is > 0) or( amount * .0000089 > .00005 )

I searched the forum .. But couldnt find any posts which satisfy the above criteria.

The file is FB 80 byte file...

Amount is coming pos 1.

Thanks,
-Mt
Back to top
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Dec 13, 2007 12:52 pm    Post subject: Reply with quote

Sorry .. the condition is

if (amount is < 0) or (amount * .0000089 > .00005 )
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Thu Dec 13, 2007 1:32 pm    Post subject: Reply with quote

Martin wrote:
Sorry .. the condition is

if (amount is < 0) or (amount * .0000089 > .00005 )


Why not just divide .0000089 by .00005 and compare with that value?
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Dec 13, 2007 2:07 pm    Post subject: Reply with quote

So we have a 3-byte PD value that represents sddd.dd (e.g. X'12345C' represents +123.45). .0000089 divided by .00005 is 0.178 so we should be able to compare the sddd.dd value to .18. The value doesn't actually have the decimal point so we're really comparing sddddd to +18 (or +17?). Thus, the DFSORT INCLUDE statement would be:

Code:

    INCLUDE COND=(1,3,PD,LT,0,OR,1,3,PD,GT,18)


Does that work?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Fri Dec 14, 2007 4:58 am    Post subject: Reply with quote

Hi All,

Thanks for the prompt reply... There is a change in my requirement.

Input file :
Code:

Amt1    Amt2
-100    +0.001
+001   +0.002
-001    +0.001
.
.
.
.
.

Amount1 ( shown above is in COMP-3 format ... 9(03)v9(02))
Amount2 ( shown above is in COMP-3 format ... 9(03)v9(03))

I need to write out the records which satisfy the below criteria.

if (amount1 is < 0) or( Amount1 >0 and (amount1 * Amount2 > .00005) )

The file is FB 80 byte file...

Amount1 is coming pos 1.
Amount2 is coming pos 8.

Thanks,
-Mt
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Dec 14, 2007 12:17 pm    Post subject: Reply with quote

Martin,

Try these control cards
Code:

//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTREC IFTHEN=(WHEN=(1,3,PD,GT,0),                 
        OVERLAY=(81:1,3,PD,MUL,8,4,PD,PD,LENGTH=5)),
         IFTHEN=(WHEN=NONE,                           
        OVERLAY=(81:2Z,1,3))                         
                                                 
                                     
  OUTFIL INCLUDE=(81,5,PD,LT,0,OR,   
                  81,5,PD,GT,5),     
  BUILD=(1,80)                       
//*


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group