Hi All,
I have defined one field as alphanumeric and need to check numeric validations .i am not able to check below numeric valiations
if user entered 1b2 (b blank = space) it should not allow it should give erorr, but in my case it is considering as 012 as I am using BIF DEEDIT function
can you please let me know how to error out in this case
Thanks
Venkat
need help to check numeric check
-
- Posts: 10
- Joined: Mon Mar 23, 2015 6:21 pm
- Skillset: Mainframe
- Referer: WEBSITE
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: need help to check numeric check
Don't "de-edit" it. Or at least not until it is validated.
-
- Posts: 10
- Joined: Mon Mar 23, 2015 6:21 pm
- Skillset: Mainframe
- Referer: WEBSITE
Re: need help to check numeric check
I need to edit for the leading zeroes if user entered 1 it should display as 001
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: need help to check numeric check
You don't need to de-edit for that. And read what I wrote. If you do feel you "need" to do it, do it after the validation.
-
- Posts: 10
- Joined: Mon Mar 23, 2015 6:21 pm
- Skillset: Mainframe
- Referer: WEBSITE
Re: need help to check numeric check
Thanks for your suggestions , I need help for validating the below cases
The input field defined as Character x(03)
user entered
bb1 (b blank) ---- it should convert to 001
b1b --- it should convert to 001
bb1 ---- it should convert to 001
1bb ---- it should convert to 001
1b1 ---- it should rejected-error
any character or special character in this field it should reject.
The input field defined as Character x(03)
user entered
bb1 (b blank) ---- it should convert to 001
b1b --- it should convert to 001
bb1 ---- it should convert to 001
1bb ---- it should convert to 001
1b1 ---- it should rejected-error
any character or special character in this field it should reject.
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: need help to check numeric check
What language are you using? I believe COBOL has a NUMERIC or ISNUMERIC BIF to check if a value is numeric.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
-
- Posts: 10
- Joined: Mon Mar 23, 2015 6:21 pm
- Skillset: Mainframe
- Referer: WEBSITE
Re: need help to check numeric check
I am using Cobol and if I use is numeric for that field it won't accept as this has spaces.
i am not sure about the ISNUMERIC BIF can you please give some expample.
i am not sure about the ISNUMERIC BIF can you please give some expample.
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: need help to check numeric check
If you define the input field as numeric, it'll help.
-
- Posts: 10
- Joined: Mon Mar 23, 2015 6:21 pm
- Skillset: Mainframe
- Referer: WEBSITE
Re: need help to check numeric check
I have declared as numeric and tested still i am getting error when user entered bb0 it should accept this value and should display as 000 ,
And also if i enter bb1 it shuould not give error it should be 001 .
User has entered full 3 bytes are numeric then only it will accept other it won't,
In need to accept all these cases
b1 (b blank) ---- it should convert to 001
b1b --- it should convert to 001
bb1 ---- it should convert to 001
1bb ---- it should convert to 001
1b1 ---- it should rejected-error
And also if i enter bb1 it shuould not give error it should be 001 .
User has entered full 3 bytes are numeric then only it will accept other it won't,
In need to accept all these cases
b1 (b blank) ---- it should convert to 001
b1b --- it should convert to 001
bb1 ---- it should convert to 001
1bb ---- it should convert to 001
1b1 ---- it should rejected-error
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: need help to check numeric check
So you will need to check each character individually -- either using reference modification or by moving the variable to a redefined variable. Are you sure your variable is getting spaces -- usually CICS uses LOW-VALUES for screen variables? Your error checking code using reference modification should be something along the lines of
Code: Select all
IF VARI (1 : 1) >= '0' AND VARI (2 : 1) = SPACE AND VARI (3 : 1) >= '0'
<handle the error>
ELSE
IF (VARI (1 : 1) > SPACE AND < '0') OR (VARI (2 : 1) > SPACE AND < '0') OR (VARI (3 : 1) > SPACE AND < '0')
<handle non-numeric data>
ELSE
<use BIF DEEDIT on the variable>
END-IF
END-IF
-
- Similar Topics
- Replies
- Views
- Last post
-
- 0
- 3480
-
by zeller56
View the latest post
Sun Oct 01, 2023 1:50 am
-
- 10
- 4056
-
by chillmo
View the latest post
Thu Mar 13, 2025 12:01 am
-
-
Security Check for Data centre migration
by aarvalar1 » Fri Apr 14, 2023 4:58 pm » in Mainframe Security - 2
- 2530
-
by aarvalar1
View the latest post
Mon Apr 17, 2023 2:50 pm
-
-
-
Getting 0F01C008 Error while running SMP/e Apply Check Job
by csakil » Tue Apr 06, 2021 10:58 pm » in System programming - 0
- 2840
-
by csakil
View the latest post
Tue Apr 06, 2021 10:58 pm
-
-
-
Need to check whether file is ESDS file or not by using REXX
by Devrana » Sat Oct 05, 2024 2:28 pm » in CLIST & REXX - 6
- 3050
-
by sergeyken
View the latest post
Tue Oct 08, 2024 5:25 pm
-