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 data if it has the format "999.99"

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

New User


Joined: 26 Feb 2004
Posts: 19
Location: Chennai

PostPosted: Mon Dec 06, 2004 8:19 pm    Post subject: Checking data if it has the format "999.99"
Reply with quote

Hi

I have an input data file with some 50,000 records. My requirement is to check if the value for a field is in the format "999.99".

If the data satisfies the format "999.99" then retain the record/data else
delete the record.

now how do i go about coding this in COBOL pgm? any simplest way to check if Data is in the format "999.99"

Pls help. I' have already found a way but not a feasible method. I would appreciate if any one can come out with some possible and optmised solution.

Thanks in advance. icon_smile.gif

With Lov,
Back to top
View user's profile Send private message

lramani

New User


Joined: 03 Nov 2004
Posts: 21
Location: NOIDA, India

PostPosted: Tue Dec 07, 2004 10:50 am    Post subject:
Reply with quote

Hi Aninya,

Was just thinking about one of the soln for ur Q.

1) First of all is this just one field that u need to check in ur file for the format??
2) Is that perticular field distinct enough. In the sense does it have a space before or after that field??

fo example if the field in the file is

ABCD 123.89 CFGK
ABC 099.12 KFGL
1234 12.34 LMNK
LKMN MNP.CC HJL

If iam not wrong u want the first two records and not the last two (considering that the second field is the one that u r checking the format). I guess this is ur requirement..right??.

Might be u could have a INSPECT tallying BEFORE and AFTER decimal(.)

but one problem is this would list even 4th record which has (MNP.CC) but u could check for IS NUMERIC and eliminate this record too.

To be very honest ..i have not worked with INSPECT TALLYING. Its on the basis of thoery that i have provided u this soln. If this soln seems to be ok or has a loop hole anywhere then please let me know in either case.
Back to top
View user's profile Send private message
lramani

New User


Joined: 03 Nov 2004
Posts: 21
Location: NOIDA, India

PostPosted: Tue Dec 07, 2004 10:50 am    Post subject:
Reply with quote

Hi Aninya,

Was just thinking about one of the soln for ur Q.

1) First of all is this just one field that u need to check in ur file for the format??
2) Is that perticular field distinct enough. In the sense does it have a space before or after that field??

fo example if the field in the file is

ABCD 123.89 CFGK
ABC 099.12 KFGL
1234 12.34 LMNK
LKMN MNP.CC HJL

If iam not wrong u want the first two records and not the last two (considering that the second field is the one that u r checking the format). I guess this is ur requirement..right??.

Might be u could have a INSPECT tallying BEFORE and AFTER decimal(.)

but one problem is this would list even 4th record which has (MNP.CC) but u could check for IS NUMERIC and eliminate this record too.

To be very honest ..i have not worked with INSPECT TALLYING. Its on the basis of thoery that i have provided u this soln. If this soln seems to be ok or has a loop hole anywhere then please let me know in either case.
Back to top
View user's profile Send private message
lramani

New User


Joined: 03 Nov 2004
Posts: 21
Location: NOIDA, India

PostPosted: Tue Dec 07, 2004 11:20 am    Post subject:
Reply with quote

hi Aninya,
First of all sorry for posting twice.
secondly...i could find a loop hole myself.
Inspect will be used for character string. Later checking the same for IS NUMERIC is not possible.

Onething that is still feasible with the same soln is
check for IS NUMERIC first.
Define another character field....to move this field and then use the inspect clause (before and after ".").

I guess that shud work...what say??
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm

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