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
 

 

Comparing a field with low or high values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
deesun

New User


Joined: 29 Aug 2006
Posts: 15

PostPosted: Mon Sep 03, 2007 6:42 pm    Post subject: Comparing a field with low or high values
Reply with quote

need to Cobol equivalent in SQL

See the below code


Min-num Pic x.
Max-num Pic x.
record1 pic x

Procedure-division.
Move Low-values values to min-num
Move High values to MAX-NUM

If record1 is GE Min-num and LE Max-num
Calculate total.



assume that record1 has a value 'A' and now in this case what will happen for the above comparision???? what will be min-num ,max num and will total be calulated
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Sep 03, 2007 7:19 pm    Post subject:
Reply with quote

Min-num = X'00'
A = X'C1'
Max-num = X'FF'

"total" will always be calculated............
Back to top
View user's profile Send private message
deesun

New User


Joined: 29 Aug 2006
Posts: 15

PostPosted: Mon Sep 03, 2007 7:25 pm    Post subject: Another question
Reply with quote

Thanks

what would happen if the value of record1 is spaces for the above condition
Back to top
View user's profile Send private message
deesun

New User


Joined: 29 Aug 2006
Posts: 15

PostPosted: Mon Sep 03, 2007 7:31 pm    Post subject:
Reply with quote

also please let me know what will happen for the below condition


Min-num Pic x.
Max-num Pic x.
record1 pic x

Procedure-division.
Move Spaces to min-num
Move Spaces to MAX-NUM

If record1 is GE Min-num and LE Max-num
Calculate total.


assume that record1 has a value 'A' and now in this case what will happen for the above comparision???? what will be min-num ,max num and will total be calulated
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Mon Sep 03, 2007 8:04 pm    Post subject:
Reply with quote

deesun wrote:
what would happen if the value of record1 is spaces for the above condition
A = X'40'
What part of greater than or equal to the lowest possible value and less than or equal to the greatest possible value do you not understand?
William Thompson wrote:
"total" will always be calculated............
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Sep 03, 2007 8:07 pm    Post subject:
Reply with quote

Min-num = X'40'
A = X'C1'
Max-num = X'40'

"total" will only be calculated when record1 contains a space......
Back to top
View user's profile Send private message
deesun

New User


Joined: 29 Aug 2006
Posts: 15

PostPosted: Mon Sep 03, 2007 8:10 pm    Post subject:
Reply with quote

THanks
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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