Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
deesun

New User

Joined: 29 Aug 2006
Posts: 15

 Posted: Mon Sep 03, 2007 6:42 pm    Post subject: Comparing a field with low or high values 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

William Thompson

Global Moderator

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

 Posted: Mon Sep 03, 2007 7:19 pm    Post subject: Min-num = X'00' A = X'C1' Max-num = X'FF' "total" will always be calculated............
deesun

New User

Joined: 29 Aug 2006
Posts: 15

 Posted: Mon Sep 03, 2007 7:25 pm    Post subject: Another question Thanks what would happen if the value of record1 is spaces for the above condition
deesun

New User

Joined: 29 Aug 2006
Posts: 15

 Posted: Mon Sep 03, 2007 7:31 pm    Post subject: 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
CICS Guy

Senior Member

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

Posted: Mon Sep 03, 2007 8:04 pm    Post subject:

 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............
William Thompson

Global Moderator

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

 Posted: Mon Sep 03, 2007 8:07 pm    Post subject: Min-num = X'40' A = X'C1' Max-num = X'40' "total" will only be calculated when record1 contains a space......
deesun

New User

Joined: 29 Aug 2006
Posts: 15

 Posted: Mon Sep 03, 2007 8:10 pm    Post subject: THanks
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us