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 

SYNCSORT giving problems when trying to use SUB for subtract

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


Joined: 29 Nov 2005
Posts: 26
Topics: 9

PostPosted: Tue Nov 29, 2005 1:23 pm    Post subject: SYNCSORT giving problems when trying to use SUB for subtract Reply with quote

I was trying to use the SUB Arithmetic operator in the INREC statement and am not able to get the ouput in the desired 'BI' format. When I do not give BI it gives me the results in M0 format.When I try to do BI it does not return me the sign (-) for negative numbers. Please help. I have attached my sort statements below.


Code:

INREC FIELDS=(1,11,
              22,10,             
              148,4,BI,SUB,152,4,BI,BI,LENGTH=4)
SORT FIELDS=(1,21,CH,A)               
INCLUDE COND=(((146,2,CH,EQ,C'D1',OR,
               146,2,CH,EQ,C'D2',OR, 
               146,2,CH,EQ,C'D3'),AND,
               66,2,CH,EQ,X'0065'),OR,
              ((146,2,CH,NE,C'D1',AND,
               146,2,CH,NE,C'D2',AND,
               146,2,CH,NE,C'D3'),AND,
               66,2,CH,EQ,X'0064'))
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Nov 29, 2005 1:32 pm    Post subject: Reply with quote

Pknair,

In what format do you want to store the result from the subtraction ?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Nov 29, 2005 1:40 pm    Post subject: Reply with quote

BI is strictly for positive binary numbers (e.g. X'FFFF' is 65535). FI is for positive and negative binary numbers (e.g. X'FFFF' is -1).

It doesn't make any sense to say
Quote:
When I try to do BI it does not return me the sign (-) for negative numbers.
since BI values are unsigned (only positive).
_________________
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
Pknair
Beginner


Joined: 29 Nov 2005
Posts: 26
Topics: 9

PostPosted: Tue Nov 29, 2005 2:53 pm    Post subject: Reply with quote

Thank you Kolusu and Frank. I understood my mistake and changed BI to FI.
Back to top
View user's profile Send private message
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