Page 1 of 1

Need help with INCLUDE, OMIT for SUMmed records

PostPosted: Thu Nov 01, 2012 9:31 pm
by RockinRiles
I've looked thru the first 5 pages but, have not found my questions.

Here's my situation:
Input records will have multiple records per SSN.
Inrecs have a flag field for out-of-state earnings.
Summing on Salary into one Outrec per SSN.

I want to do:
1. Not include Inrecs with out-of-state flag = 1 in summing
2. Only write Outrecs for Summed earnings > 250000

My confusion is this: Do Includes and Omits relate to only Inrecs?

Can I perform edits on individual inrecs as well as summed outrecs?
If yes, how so?

I hope I've explained this well enough for ya'll to understand.

Thanks,

Rockin Riles

Re: Need help with INCLUDE, OMIT for SUMmed records

PostPosted: Thu Nov 01, 2012 9:36 pm
by Pandora-Box
I would suggest you to post the sample input and the output you are expecting

As that would help everyone to understand the problem easliy than trying to narrate theoritically ( I am sorry I hardly got your problem )

Please clarify

Re: Need help with INCLUDE, OMIT for SUMmed records

PostPosted: Thu Nov 01, 2012 9:39 pm
by dick scherrer
Yup, totally agree.

Also, please post the Syncsort release you are running.

Re: Need help with INCLUDE, OMIT for SUMmed records

PostPosted: Thu Nov 01, 2012 10:33 pm
by RockinRiles
Understood. I'm home with my sick son so, I don't have any info on our Syncsort version info.
Please don't kill me for syntax errors. :)

Note: I'm not looking for the specific code (although welcome) as much as an explanation
if I can do what I want to do in one step.

Inrec record format:
SSN 1,9
filler 10,1
Out-of-State 11,1
filler 12,1
Salary 13,6

Inrecs:
123456789 1 125000 <--- Will NOT be included in INCLUDE for summing: Out-of-State flag = 1
123456789 0 150000 <--- Will be included in INCLUDE and Summing, Out-of-State flag = 0
123456789 0 100001 <--- Will be included in INCLUDE and Summing, Out-of-State flag = 0
::: Salary total = 250001. Write to Outrec as Summed Salary > 250000

987654321 0 200000 <--- Will be included in INCLUDE and Summing, Out-of-State flag = 0
987654321 1 100000 <--- Will NOT be included in INCLUDE and Summing, Out-of-State flag = 1
987654321 0 020000 <--- Will be included in INCLUDE and Summing, Out-of-State flag = 0
::: Salary total = 220000. Do NOT Write to Outrec as Summed Salary NOT > 250000

Desired Outrecs:
123456789250001

Sort code:

SORT FIELDS=(1,9,PD,A)
SUM FIELDS=(13,6,PD)
OUTREC FIELDS=(1,9,PD,
13,6,PD)
INCLUDE (11,1,EQ,0) <--- Want this to INCLUDE Out-of-State flags = 0
INCLUDE (13,6,GT,250000) <--- This is my challenge! I want this to "only" include SUMmed record if total > 250000.

Hope this helps.

Thanks,

Rockin Riles

Re: Need help with INCLUDE, OMIT for SUMmed records

PostPosted: Fri Nov 02, 2012 1:52 am
by BillyBoyo
I think you are looking at two different includes.

You can INCLUDE COND=( for the "out of state records" as you have.

Then, once the SUM is completed, you can have OUTFIL INCLUDE=( for the SUMmed amount GT 25000.

The first INCLUDE gets rid of records you don't want to process, the second, on OUTFIL, is used to select records you want on the output file.

Re: Need help with INCLUDE, OMIT for SUMmed records

PostPosted: Fri Nov 02, 2012 2:33 am
by RockinRiles
Thanks BillyBoyo! :D

I'll post my solution soon.

Rockin Riles