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
 

 

FileAid Tally/Accum from several positions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools
View previous topic :: :: View next topic  
Author Message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Sat Feb 09, 2013 3:05 am    Post subject: FileAid Tally/Accum from several positions
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: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Sat Feb 09, 2013 4:30 am    Post subject:
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: 147
Location: Columbia, MO

PostPosted: Tue Feb 12, 2013 9:44 pm    Post subject:
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: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Tue Feb 12, 2013 10:15 pm    Post subject:
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: 147
Location: Columbia, MO

PostPosted: Mon Feb 18, 2013 11:33 pm    Post subject:
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: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Mon Feb 18, 2013 11:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Using Field names in FILEAID Batch CO... Atul Banke Compuware & Other Tools 2 Wed Jun 29, 2016 9:54 pm
No new posts FileAid to compare(logical operations... anand1204 Compuware & Other Tools 3 Wed Apr 06, 2016 2:55 am
No new posts File matching with PD key on differen... hiravibk DFSORT/ICETOOL 2 Wed Feb 17, 2016 11:40 pm


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