Select only paired records



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Select only paired records

Postby BillyBoyo » Tue Jul 15, 2014 12:13 pm

You need to change that INCLUDE= to an OMIT= to test for space at the start of the extended record. Or change the code to PUSH a SEQ not an ID and INCLUDE= for two. Then you don't need the SECTIONs anyway.

Any records you don't want from the original input, you use INCLUDE COND=/OMIT COND=. Any records you don't want after they have arrived at OUTFIL processing, you use INCLUDE=/OMIT=.

You need to go through that Getting Started guide.

PS. I see I was answering a different question earlier. Sorry about that. You don't need the '/' operator at all here, as you are turning two into one (where two exist as a pari) not splitting one into two... so it's even simpler. The BUILD you need to just to rearrange the data how you want it and to ingore the extened SEQ-field.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Re: Select only paired records

 

Re: Select only paired records

Postby venubhat » Tue Jul 15, 2014 12:53 pm

will this work??

INCLUDE=(70:SEQ=2) or anything else need to be added..tried OMIT from OUTFIL to test for spaces so that can remove them but wasn't successful.
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Select only paired records

Postby BillyBoyo » Tue Jul 15, 2014 1:00 pm

Where did you test for space? You need to test a byte (or more) of where the data from a previous record has been PUSHed to.

Without seeing the control cards you are using, I don't know where that is.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Select only paired records

Postby venubhat » Tue Jul 15, 2014 1:31 pm

here is my cntl card

OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(7,5,CH,EQ,C'ADMIN'),
END=(7,4,CH,EQ,C'USER'),
PUSH=(34:7,26,70:ID=1))
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(70,1,TRAILER3=(1,5,34,26,X,7,26)),
OMIT=(7,5,CH,EQ,C' ')
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Select only paired records

Postby BillyBoyo » Tue Jul 15, 2014 2:46 pm

 OPTION COPY
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(7,5,CH,EQ,C'ADMIN'),
                          END=(7,4,CH,EQ,C'USER'),
                          PUSH=(34:7,26,70:ID=1))
 OUTFIL REMOVECC,NODETAIL,
        SECTIONS=(70,1,TRAILER3=(1,5,34,26,X,7,26)),
        OMIT=(7,5,CH,EQ,C' ')


You PUSH the data to location 34, but OMIT= on column 7. Change the OMIT= to (34,5....

You no longer then have multiple records (where there is a pair of records) so you don't need SECTIONS. Since you don't need SECTIONS, you don't need REMOVECC or NODETAIL. You do need to rearrange the data, so you'll need a BUILD with the same content as your current TRAILER3.

As I've said, I'd use KEYBEGIN and PUSH a SEQ not an ID, and INCLUDE= for the SEQ-field being two and use BUILD to rearrange.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Select only paired records

Postby venubhat » Tue Jul 15, 2014 3:12 pm

thaknks billy that's working...!!!

have another Q in the same segment.

i/p
20006 ADMIN
20007 USER
20008 CUSTOMER
20006 AUTH

o/p
20006 ADMIN
20006 AUTH

basically when a rec i.e 20006 in this ex. has both ADMIN & AUTH only then it should be written to o/p file. if a rec has either only ADMIN or only USER or any other names should not be coming in o/p file. help in this regard is also much appreciated..

thanks
venu
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Select only paired records

Postby Magesh23586 » Tue Jul 15, 2014 3:29 pm

What is you try on this new requirement ?

Come up with your code.

Regards,
Magesh
Magesh23586
 
Posts: 35
Joined: Sat Jul 05, 2014 5:36 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Select only paired records

Postby venubhat » Tue Jul 15, 2014 3:39 pm

I tried the normal sort with OR cond so I get all records that have either ADMIN/AUTH but wanted only those rec which have both these..

thanks
venu
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Select only paired records

Postby Magesh23586 » Tue Jul 15, 2014 6:11 pm

Share your code to suggest.

Thanks
Magesh
Magesh23586
 
Posts: 35
Joined: Sat Jul 05, 2014 5:36 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Select only paired records

Postby venubhat » Tue Jul 15, 2014 11:15 pm

code.....??? mean my sort card...??

SORT FIELDS=(1,8,CH,A)
INCLUDE COND=(9,5,CH,EQ,C'ADMIN'), OR, (9,4,CH,EQ,C'AUTH')

is that wht u wanted...

thanks
venu
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post