IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FileAid Tally/Accum from several positions


IBM Mainframe Forums -> Compuware & Other Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Sat Feb 09, 2013 3:05 am
Reply with quote

G'Day Gents and Ladies!

I've got a file that contains a field that repeats 10 times. The value for which I am searching can appear in any, several, or none of those 10 positions.

I'm trying to count the total number of records in which the value appears and have experienced some problems. I'd just do it in interactive mode, but with over 50 million records, I just don't want to sit here all day!

This code gives me an individual total for each position (edited for brevity's sake):
Code:
$$DD01 TALLY IF=(55,EQ,T'B-636.3-B'),
                       ACCUM=(582,1,C,'RECORD COUNT'),
             IF=(107,EQ,T'B-636.3-B'),
                       ACCUM=(582,1,C,'RECORD COUNT')


Then I manually add the 10 results together. Yeah, it works, but I know there has to be a better way.

I've tried all 10 IF's with a single ACCUM, but realized that it then requires all IF's to be true before accumulating. Seizing on that discovery, I tried ORIF's with just the first two columns:

Code:
$$DD01 TALLY IF=(055,EQ,T'B-636.3-B'),         
           ORIF=(107,EQ,T'B-636.3-B'),         
                ACCUM=(582,1,C,'RECORD COUNT')


This just gave me the total for the second column, not the first. Inserting a second ACCUM statement between the IF's just gave me the individual totals again.

So what am I missing?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 09, 2013 4:30 am
Reply with quote

Why not follow the File Aid Batch Reference Manual examples and code it as
Code:
$$DD01 TALLY IF=(055,EQ,T'B-636.3-B',         
                 107,EQ,T'B-636.3-B'),         
                ACCUM=(582,1,C,'RECORD COUNT')
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Tue Feb 12, 2013 9:44 pm
Reply with quote

Well, I'm referring to File Aid Batch Reference Manual Release 9.2 and I don't see an example like that. However, I gave it a whirl and got this:

Code:
$$DD01 TALLY IF=(055,EQ,T'B-636.3-B',               
                 107,EQ,T'B-636.3-B',               
                 159,EQ,T'B-636.3-B',               
                 211,EQ,T'B-636.3-B',               
                 263,EQ,T'B-636.3-B',               
                 315,EQ,T'B-636.3-B',               
                 367,EQ,T'B-636.3-B',               
                 419,EQ,T'B-636.3-B',               
                 471,EQ,T'B-636.3-B',               
                 523,EQ,T'B-636.3-B'),               
                ACCUM=(582,1,C,'RECORD COUNT B-636.3-B')

F I L E - A I D  V9.3.1  FEB - 12 - 2013   10.01.43          *ACCUM TOTALS LIST*
                                                                               
                        FOLLOWING TOTALS DEVELOPED FROM                         
             AT.REW.#030.MAC60560.CMPOSITE.FUTR.G0001V00 VOL=TST002             
                                                                               
          RECORD COUNT B-636.3-B--------------------------------------------0   

The problem is, totalling by each column and manually adding up the column totals gives me:
Code:
COL 01 B-636.3-B------------------------------------------------262
COL 02 B-636.3-B------------------------------------------------388
COL 03 B-636.3-B------------------------------------------------232
COL 04 B-636.3-B-------------------------------------------------71
COL 05 B-636.3-B-------------------------------------------------45
COL 06 B-636.3-B-------------------------------------------------13
COL 07 B-636.3-B--------------------------------------------------4
COL 08 B-636.3-B--------------------------------------------------0
COL 09 B-636.3-B--------------------------------------------------0
COL 10 B-636.3-B--------------------------------------------------0
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 12, 2013 10:15 pm
Reply with quote

The latest version of the Batch Reference manual I have is 9.1, which includes section 4.26.1, which has
Quote:
Example2:

$$DD01 PRINT IF=(1,EQ,C'A',17,EQ,C'1,2,3')
$$DD01 PRINT IF=(1,EQ,C'A',17,EQ,C'1',17,EQ,C'2',17,EQ,C'3')


Example 2 shows two types of coding to print records that contain the character A in location 1, OR have the character 1, 2, or3 in location 17.
and I tested with
Code:
$$DD01   TALLY IF=(055,EQ,T'B-636.3-B',
                   070,EQ,T'B-636.3-B',
                   085,EQ,T'B-636.3-B',
                   100,EQ,T'B-636.3-B'),
                   ACCUM=(1,1,C,'RECORDS')
and 15 records in the file -- 5 blanks ones and 1 matching column 55, 2 matching 70, 3 matching 85, and 4 matching 100. My results are
Code:
          RECORDS----------------------------------------------------------10
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Mon Feb 18, 2013 11:33 pm
Reply with quote

Sweet - I used your example and got the right answer.

I wonder why they changed the manual......oh crap - they didn't. icon_redface.gif

And it's still 4.26.1. Boy, do I feel dumb now.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 18, 2013 11:35 pm
Reply with quote

LOL -- at least you got the right answer!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Compuware & Other Tools

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts Remove commas from specific positions... DFSORT/ICETOOL 10
No new posts finding anydata between positions of ... SYNCSORT 13
No new posts Fileaid 2 commands instream work. In ... Compuware & Other Tools 2
Search our Forums:

Back to Top