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
 

 

LOW VALUES and HIGH VALUES

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

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Tue Aug 19, 2008 10:17 am    Post subject: LOW VALUES and HIGH VALUES
Reply with quote

Hi Could anyone tell me where can we possibly use LOW VALUES and HIGH VALUES..
Actually i have to check for NOT NUMERIC data as well as LOW VALUES, so are these low values some kind of values that come neither in NUMERIC nor in ALPHANUMERIC data? coz when i consulted about it, i got the response as LOW VALUES are those values that are some kinds of Special charecters...
Could anyone help me out regarding LOW VALUES and HIGH VALUES? icon_rolleyes.gif
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 19, 2008 10:45 am    Post subject: Re: LOW VALUES and HIGH VALUES
Reply with quote

Hi,
Abhushan_s wrote:
Could anyone help me out regarding LOW VALUES and HIGH VALUES?

There are occasions when you may wish to set a variable to an infinitely high or infinitely low number. For example, suppose you were merging two files on surnames as the primary key:

*in data division FILE SECTION
Code:
 FD FILE-1.
 01 RECORD-1.
     03 IN-NAME-1 PIC X(20).
     03 FILLER    PIC X(50).

 FD MERGE-FILE.
 01 RECORD-OUT    PIC X(70).

   :
   :

   PERFORM WITH TEST AFTER EOF-FLAG-1 AND EOF-FLAG-2
*loop until each file has been read to completion
*read each file
Code:
      READ FILE-1
          AT END SET EOF-FLAG-1 TO TRUE
          MOVE HIGH-VALUES TO IN-NAME-1
      END-READ
      READ FILE-2
          AT END SET EOF-FLAG-2 TO TRUE
          MOVE HIGH-VALUES TO IN-NAME-2
      END-READ

*sort the records (assuming no 2 names are the same)
*on ascending surname
Code:
      IF IN-NAME-1 IS < IN-NAME-2 THEN
          WRITE RECORD-OUT FROM RECORD-1
      ELSE
          WRITE RECORD-OUT FROM RECORD-2
      END-IF

   END-PERFORM

In this example, when IN-NAME-1 is less than IN-NAME-2 (based on their ASCII values e.g. A < B etc..) then the FILE-1 record (RECORD-1) is written to the merge file (RECORD-OUT). One of FILE-1 and FILE-2 will come to an end before the other so the completed file has its IN-NAME- value set to constant that will ALWAYS be greater than the IN-NAME- value still being read, ensuring all remain files are written to the merge file. This is done with the lines: MOVE HIGH-VALUES TO IN-NAME-1 and MOVE HIGH-VALUES TO IN-NAME-2.

Quote:
Actually i have to check for NOT NUMERIC data as well as LOW VALUES, so are these low values some kind of values that come neither in NUMERIC nor in ALPHANUMERIC data? coz when i consulted about it, i got the response as LOW VALUES are those values that are some kinds of Special charecters...

It is important to note that HIGH-VALUES and LOW-VALUES are ALPHANUMERIC in type, so you can't set numerically defined variables to this type (you would have to implicitly redefine the variable first). This is an annoying quirk of COBOL.

Hope this helps..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 19, 2008 11:07 am    Post subject:
Reply with quote

Hello,

LOW-VALUES and HIGH-VALUES are "figurative constants".

For the word from IBM, look here:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr10/1.2.7?
Back to top
View user's profile Send private message
Abhushan_s

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Tue Aug 19, 2008 11:07 am    Post subject: ERROR encountered
Reply with quote

Hey Anuj thanks for the reply, It helped.

I would like to just re-phrase what you mentioned.

Is it that, as the values in either FILE-1 or FILE-2 will come to an end, we need to keep one of the values or both of them to a high value that will cause all the eligible records in both the files to be written to the output file?

Actually i have another issue, iam checking for the value in a field 'WS-A' and i dont want it to either be NOT NUMERIC or LOW VALUES. but when i give the condition as
IF WS-A IS NOT NUMERIC OR LOW-VALUES

It shows an error which is
"An invalid abbreviated relation condition was found. The statement was
discarded." on the above conditional statement.

Is the error due to wrong syntax?


please let me know the correct syntax of it.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Tue Aug 19, 2008 4:54 pm    Post subject:
Reply with quote

Quote:
IF WS-A IS NOT NUMERIC OR LOW-VALUES
This is syntactically invalid; if you carry the condition through you get IF WS-A NOT NUMERIC OR NOT LOW-VALUES, and NOT LOW-VALUES is invalid. You need to have
Code:
IF WS-A NOT NUMERIC AND WS-A NOT = LOW-VALUES
. You don't want an OR condition, anyway -- why have an IF test in that case?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 19, 2008 5:07 pm    Post subject:
Reply with quote

as Robert indicated, your syntax is bad. but that was based on your verbiage, which was also incorrect:
Quote:

i dont want it to either be NOT NUMERIC or LOW VALUES

should have been:

i dont want it to be NOT NUMERIC and I don't want it to be equal to LOW VALUES
Back to top
View user's profile Send private message
Abhushan_s

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Tue Aug 19, 2008 5:09 pm    Post subject:
Reply with quote

Hey Robert thanks for the help. icon_biggrin.gif [/quote]
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 19, 2008 5:13 pm    Post subject:
Reply with quote

Hi,

Good, the syntax worked for you, however, you didn't answer this
Quote:
why have an IF test in that case?
yet, asked by Robert..
Back to top
View user's profile Send private message
Abhushan_s

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Tue Aug 19, 2008 5:17 pm    Post subject:
Reply with quote

Actually Anuj, i have a case to test whether the field is having a non numeric data and also check whether it has LOW-VALUES.
i was told to do that, nut i also asked y do we need the IF condition , but then there is some standard i had to follow so even i was confused in the beginning icon_confused.gif but then no harm in checking again! icon_lol.gif .
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Aug 20, 2008 11:34 am    Post subject:
Reply with quote

Hi,
Abhushan_s wrote:
i have a case to test whether the field is having a non numeric data and also check whether it has LOW-VALUES.
Probably, one would expect to have two different behaviour of program on these two checks, well, anyway..
Quote:
i was told to do that
well, if one has a better suggestion, one must know the tactics to let other know aboout that...even to seniors .. icon_smile.gif


Probably I skipped to answer it in previous hit to this thread..
Quote:
Is it that, as the values in either FILE-1 or FILE-2 will come to an end, we need to keep one of the values or both of them to a high value that will cause all the eligible records in both the files to be written to the output file?
answer is..Yes.
Back to top
View user's profile Send private message
Abhushan_s

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Wed Aug 20, 2008 2:42 pm    Post subject: Reply to: LOW VALUES and HIGH VALUES
Reply with quote

Hey Anuj, Thanks for the Reply. I would keep that in mind. icon_smile.gif
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 ESQA overflow - high ECSA utilization vasanthz All Other Mainframe Topics 1 Thu Dec 29, 2016 7:06 am
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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