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
 

 

Validation - integer in cobol CICS

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

New User


Joined: 25 Jun 2007
Posts: 40
Location: chennai

PostPosted: Fri Aug 03, 2007 2:19 pm    Post subject: Validation - integer in cobol CICS
Reply with quote

validation for number field
whether they have entered any spaces???
how to check that in the code.
if they have entered a number and space i have to ignore the space if number has been entered.
Back to top
View user's profile Send private message

palas_08
Currently Banned

New User


Joined: 26 Feb 2007
Posts: 9
Location: kolkatta

PostPosted: Fri Aug 03, 2007 6:50 pm    Post subject: integer in cobol CICS
Reply with quote

hi,

check num is numeric or not ?
u can move to x(3)
o1 gr.
02 num pic x(3).
02 num2 redefines num.
03 a occures 3 time pic x(1).

if a(1)=' '



and then u can check .

I think this will help u

with regards
palas
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Aug 03, 2007 7:08 pm    Post subject:
Reply with quote

you can always use the numval function which will return either a number (spaces removed) or an error telling you that there are alpha characters.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Aug 03, 2007 7:53 pm    Post subject:
Reply with quote

You can also use the UNSTRING command
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: Fri Aug 03, 2007 7:59 pm    Post subject:
Reply with quote

Hello,

If the user enters "123 45 ", what should happen?
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Aug 03, 2007 8:08 pm    Post subject:
Reply with quote

As stated by the question, if they enter a space he want to forget
the rest of the data in the field. if the field had bbb150 and the user
enter 275 over the bbb150 the field would look like 250b50 and
with the unstring you end up having just the 275.
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: Fri Aug 03, 2007 8:41 pm    Post subject:
Reply with quote

Hello,

Quote:
As stated by the question, if they enter a space he want to forget
the rest of the data in the field. if the field had bbb150 and the user
enter 275 over the bbb150 the field would look like 250b50 and
with the unstring you end up having just the 275.

That is one way to interpret the post. . . . Also, that when numbers are followed by spaces, the spaces should be ignored and the number properly scaled.

Which is why i posted the example with the embedded space. Should the space terminate the field, should the digits be combined into one number, or should it be an error?

We can only guess - any could be correct if the rule so defined. Maybe TS will clarify. . . .
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Aug 03, 2007 9:51 pm    Post subject:
Reply with quote

That is so TRUE....
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. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 1 Thu Jan 19, 2017 1:31 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


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