View previous topic :: View next topic
|
Author |
Message |
mitha
New User
Joined: 01 Dec 2021 Posts: 19 Location: India
|
|
|
|
Hi guys, I need to validate the field is in this [ZZZZZZZ9.99] format or not using cobol .If it is in this format need to proceed with further steps .I will do that no problem .But how to validate the field ?/Can anyone help me on this by sharing ur logic or code. Urgent!!! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
This is a help forum, where people respond as they have interest, time, and knowledge. Questions may sit on this (or any) forum for hours to weeks to months with no responses -- and that is normal. If you need urgent, have your management contract with someone to help you.
The best bet would be to use REDEFINES on the variable to have it available as an alphanumeric (PIC X) variable. You can then use reference modification to check each byte of the REDEFINED variable to be zero through nine or decimal point. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
DFSORT ? You can try as you don’t want to do with COBOL. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Quote: |
You can then use reference modification to check each byte of the REDEFINED variable to be zero through nine or decimal point. |
But leading bytes may be spaces, and decimal point placed correctly. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Look up TEST-NUMVAL function in the COBOL language reference. |
|
Back to top |
|
|
|