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 

Count of excluded fields

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


Joined: 05 Jun 2004
Posts: 46
Topics: 18

PostPosted: Fri Jan 20, 2006 12:01 am    Post subject: Count of excluded fields Reply with quote

Hi,

I have a file that is to be sorted on a certain criteria. Also, I've to create another file from this by excluding the records on a different criteria.
Now, I need to know no. of records I've processed(Total no. of records), No. of records selected or discarded and I want to pass these numbers to a program for processing.
Can anybody suggest a way to achieve this? If we get the counts into a file, that would be great.

Thanks in advance!

Mangsk
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


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

PostPosted: Fri Jan 20, 2006 1:07 am    Post subject: Reply with quote

Mangsk,

All these can be done using SORT. But you need to give us the following information.

1. LRECL & RECFM of input and output files.
2. Sample input Data
3. Condition to extract on
4. Sample output data

Thanks,
Phantom
Back to top
View user's profile Send private message
mangsk
Beginner


Joined: 05 Jun 2004
Posts: 46
Topics: 18

PostPosted: Fri Jan 20, 2006 4:46 am    Post subject: Another problem Reply with quote

Thanks Phantom for prompt response!!

The input file LRECL is 220 and it has 2 fields starting at 97 and 81 and they are defined as X(10) and X(06) respectively(let's say field 'A' and field 'B'). The condition is that I've to include only those records which have value of field A ='CURRLDGR ' and value of field B should be any of 22101,21110,21159,21150,21221.
Also, I need a count of either - Selected records or excluded records.

While trying out I came to know that this can be achieved by using COUNT in TRAILER1 in OUTFIL statement. Please see below -

SORT FIELDS=(81,6,CH,A)
INCLUDE COND=(97,10,CH,EQ,C'CURRLDGR ',AND,
81,5,CH,EQ,C'22101,21110,21159,21150,21221'),FORMAT=SS
OUTFIL TRAILER1=(1:'SELECTED:',10:COUNT15)

This works fine when I use it for only single value of field B. Even it gives the count of selected number of records.

Area of concern/Actual Problem: But when I give condition as in above control card(4-5 values), the records are selected having field A='CURRLDGR ' but the field B having only = '22101'(it is because it appears first in that group. I replaced it with other and got similar result).
Can anybody throw light on this and help me pointing out the mistake in control card?

Thanks in advance!
_________________
Regards,
Mangsk
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


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

PostPosted: Fri Jan 20, 2006 5:01 am    Post subject: Reply with quote

Mangsk,

Quote:

But when I give condition as in above control card(4-5 values), the records are selected having field A='CURRLDGR ' but the field B having only = '22101'(it is because it appears first in that group


The error is with this line
Code:

81,5,CH,EQ,C'22101,21110,21159,21150,21221'),FORMAT=SS


You have given 'CH,EQ' and also said FORMAT=SS !!!, Remove the CH,EQ and change it to SS,EQ as shown below.

Code:

  SORT FIELDS=(81,6,CH,A)
  INCLUDE COND=(97,10,CH,EQ,C'CURRLDGR ',AND,
                81,5,SS,EQ,C'22101,21110,21159,21150,21221')
  OUTFIL TRAILER1=(1:'SELECTED:',10:COUNT15)


Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
mangsk
Beginner


Joined: 05 Jun 2004
Posts: 46
Topics: 18

PostPosted: Fri Jan 20, 2006 5:07 am    Post subject: Reply with quote

That worked wonders! Very Happy
Thanks Phantom for pointing out the error...
_________________
Regards,
Mangsk
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


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

PostPosted: Fri Jan 20, 2006 5:16 am    Post subject: Reply with quote

Quote:

Also, I need a count of either - Selected records or excluded records.


Now that you want both selected and excluded counts, change the sort card as below.

Code:

  SORT FIELDS=(81,6,CH,A)
  OUTFIL FNAMES=SELECT,
        INCLUDE=(97,10,CH,EQ,C'CURRLDGR ',AND,
                 81,5,SS,EQ,C'22101,21110,21159,21150,21221'),
       TRAILER1=(1:'SELECTED:',10:COUNT15)
  OUTFIL FNAMES=EXCLUDE,SAVE,
       TRAILER1=(1:'EXCLUDED:',10:COUNT15)


Cheers,

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 -> Utilities 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