MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to check a field in the record ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
naga
Beginner


Joined: 03 Nov 2005
Posts: 3
Topics: 1
Location: INDIA

PostPosted: Thu Nov 03, 2005 2:12 am    Post subject: How to check a field in the record ? Reply with quote

A file contains number of records. We have to check everyfield,if the field contains data count the record, Otherwise should not count the record.

can u help me..
_________________
NAGA
Back to top
View user's profile Send private message Yahoo Messenger
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Thu Nov 03, 2005 2:17 am    Post subject: Reply with quote

How to check a field in the record ?
you should know the position and length of the field, if it's numeric (check for zero) or alphanumeric (check for spaces)....

I would recommend you to post an example...
( http://mvsforums.com/helpboards/viewtopic.php?p=24447#24447 )
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Thu Nov 03, 2005 2:29 am    Post subject: Reply with quote

now that I've re-read your question... I thought it was posted in the Utilities forum... sorry.

what programming language are you using?
Back to top
View user's profile Send private message
naga
Beginner


Joined: 03 Nov 2005
Posts: 3
Topics: 1
Location: INDIA

PostPosted: Thu Nov 03, 2005 2:44 am    Post subject: Reply with quote

hi,

thanks for your fast response.
I have some fields.
I want to check whether any data is present in those fields or not. if data is present we will increase the count,based on the count we have to calculate the percentage.

and the desired out put should like


COUNT STATISTICS
*---------------------------------------------------------*

TOTAL NUMBER OF RECORDS : 5,000
*-----------------------*

FIELD-NAME INCIDENCE COUNT INCIDENCE %
*--------* *-------------* *---------*

name 5000 100%
number 320 6%
_________________
NAGA
Back to top
View user's profile Send private message Yahoo Messenger
naga
Beginner


Joined: 03 Nov 2005
Posts: 3
Topics: 1
Location: INDIA

PostPosted: Thu Nov 03, 2005 3:42 am    Post subject: Reply with quote

COBOL
_________________
NAGA
Back to top
View user's profile Send private message Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Nov 03, 2005 4:25 am    Post subject: Reply with quote

Naga,

Quote:

A file contains number of records. We have to check everyfield,if the field contains data count the record, Otherwise should not count the record.


Your question is clear but not complete. You need to tell us the following.

1. how many fields you have in your file
2. what are their types (numeric / alpha...)
3. Is Zero considered as a empty condition for a Numeric field ?
4. What is the LRECL and RECFM of your file ?
5. What technology solution (COBOL / SORT / FILEAID / EASYTRIEVE) are you looking at ?

You have mentioned that your programming language is COBOL but are you trying to incorporate this COUNTER logic in COBOL ? or do you want some utilities to do this for you.

If you are using COBOL then you can simply follow the algorithm below.
Code:

1.  Read input file record by record.
2.  For each record do the following.
     2.1  If Field-1 NOT = SPACES AND NOT = ZEROES AND NOT = LOW-VALUES
            2.1.1  Increment Field-1-Counter by one
     2.2  If Field-2 NOT = SPACES AND NOT = ZEROES AND NOT = LOW-VALUES
            2.2.1  Increment Field-2-Counter by one
     ......
3.  Display Counter values.


Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group