Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Checking decimal value in the numeric field.

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

New User


Joined: 10 Mar 2011
Posts: 31
Location: india

PostPosted: Wed Jan 28, 2015 10:33 am    Post subject: Checking decimal value in the numeric field.
Reply with quote

Iam having a numeric field "23.456" or "238.768" and have to read the data from right to left.

While reading the numeric field the fourth byte should always contain "." . if the "." is not present in the fourth byte we need to display an error message.

Could you please let me know what is the approach to complete this requirement.

Thanks for the help.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Wed Jan 28, 2015 1:11 pm    Post subject: Reply to: Checking decimal value in the numeric field.
Reply with quote

Code:
01  a-nice-name..
    05  name-for-first-part-of-number PIC X(3).
    05  FILLER PIC X. 
         88  field-has-decimal-point VALUE ".".
    05  name-for-second-part-of-number PIC X(3).

IF field-has-decimal-point
AND name-for-first-part-of-number NUMERIC
AND name-for-second-part-of-number NUMERIC
    do your stuff
END-IF
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 31
Location: india

PostPosted: Sat Jan 31, 2015 12:32 pm    Post subject:
Reply with quote

Thanks Bill,

how can we check for S9(2)V999 Comp-3 field. The above logic will applies.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Sat Jan 31, 2015 1:31 pm    Post subject: Reply to: Checking decimal value in the numeric field.
Reply with quote

No. There is nothing to check for a COMP-3/PACKED-DECIMAL field, as you cant have an explicit decimal-point (.) there, only an implicit one (V).
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
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us