SYNCSORT when=group end condition with multiple end records



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

SYNCSORT when=group end condition with multiple end records

Postby chandu_rck » Mon Apr 21, 2014 11:47 pm

Hi
I have input file of rec lenght 1107.Each group starts with record type 1 and ends with rec type 9(first character) .

I want to extract the first group 1 into a separate file.
Inputfile:

1|clientname1
2|address1
2|address2
9|Account1
9|account2
1|clientname2
2|address1
9|Account 3
 

//SYSIN    DD *                                                    
   SORT FIELDS=COPY,                                                
   SKIPREC=570                                                      
   OUTREC IFTHEN=(WHEN=GROUP,END=(1,2,CH,EQ,C'9|'),PUSH(1108:ID=8))
   OUTFIL BUILD=(1,1107),INCLUDE=(1108,8,ZD,EQ,1)  
 

with the above sync sort. I am missing the second instance of 9| record.
Actual output
1|clientname1
2|address1
2|address2
9|Account1
 

Expected output
1|clientname1
2|address1
2|address2
9|Account1
9|account2<-This record is missing.
 

Appreciate your help!
chandu_rck
 
Posts: 4
Joined: Mon Apr 21, 2014 10:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT when=group end condition with multiple end rec

Postby chandu_rck » Tue Apr 22, 2014 12:04 am

HI adding to the above question.I cannot use the below Syncsort as I don't have fixed BEGIN record type. BEGIN record can be anynumber between 1 to 8.The only condition I have is I can have multiple end records of type 9.

//SYSIN DD *
SORT FIELDS=COPY,
SKIPREC=558
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'1|'),PUSH(1108:ID=8))
OUTFIL BUILD=(1,1107),INCLUDE=(1108,8,ZD,EQ,1)
//*

Thanks
chandu_rck
 
Posts: 4
Joined: Mon Apr 21, 2014 10:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT when=group end condition with multiple end rec

Postby BillyBoyo » Tue Apr 22, 2014 1:59 am

What is the SKIPREC for?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SYNCSORT when=group end condition with multiple end rec

Postby chandu_rck » Tue Apr 22, 2014 2:58 am

Sorry please ignore the skiprec.That can be removed
chandu_rck
 
Posts: 4
Joined: Mon Apr 21, 2014 10:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT when=group end condition with multiple end rec

Postby BillyBoyo » Tue Apr 22, 2014 5:21 am

This:

  OPTION COPY
                                                               
  INREC IFTHEN=(WHEN=GROUP,END=(1,2,CH,EQ,C'9|'),PUSH(40:ID=8)),
        IFTHEN=(WHEN=GROUP,
                  BEGIN=(1,2,CH,EQ,C'9|',
                       AND,40,8,CH,EQ,C'00000001'),
                  END=(1,2,CH,LT,C'9|'),
                  PUSH=(50:40,8))


With this:

                                                               
//SORTIN   DD *
1|CLIENTNAME1
2|ADDRESS1
2|ADDRESS2
9|ACCOUNT1
9|ACCOUNT2
9|ACCOUNT3
1|CLIENTNAME2
2|ADDRESS1
9|ACCOUNT 4
9|ACCOUNT 5
1|CLIENTNAME2
2|ADDRESS1
9|ACCOUNT 6


Gives this:

1|CLIENTNAME1                          00000001           
2|ADDRESS1                             00000001           
2|ADDRESS2                             00000001           
9|ACCOUNT1                             00000001  00000001
9|ACCOUNT2                             00000002  00000001
9|ACCOUNT3                             00000003  00000001
1|CLIENTNAME2                          00000004  00000001
2|ADDRESS1                             00000004           
9|ACCOUNT 4                            00000004           
9|ACCOUNT 5                            00000005           
1|CLIENTNAME2                          00000006           
2|ADDRESS1                             00000006           
9|ACCOUNT 6                            00000006 


You should be able to amend your INCLUDE= so that it gets 1,2, of '9|' and the second extended field being C'00000001' in addition to your existing condition.

There's quite a lot of repetition. Have you considered using SORT symbols? They have many advantages, one of which is only having to type positions and values once (after that you use a name).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SYNCSORT when=group end condition with multiple end rec

Postby Surabhi » Wed Nov 23, 2016 1:35 pm

Hi Billy Boyo,
I have a similar requirement.
And as you said this seems to be quite repetative.
So i am thinking of using SORT symbols the way you suggested.I tried finding some info on this but no luck.
Could you give me any link which i can refer to for this.

Thank you.
Surabhi
 
Posts: 49
Joined: Thu Sep 10, 2015 7:51 pm
Has thanked: 4 times
Been thanked: 0 time

Re: SYNCSORT when=group end condition with multiple end rec

Postby NicC » Wed Nov 23, 2016 4:56 pm

Do not address your post to a specific person.

What have you read in the manual that you do not understand?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: SYNCSORT when=group end condition with multiple end rec

Postby Surabhi » Wed Nov 23, 2016 5:15 pm

Hi,
Apologies for addressing it to a specific person.
I dint get any Link or manunal to refer for Specific Sort Symbols to be used in When=Group.
So, can anyone provide me the link which i can go through for this.
Any help appreciated.

Thank you.
Surabhi
 
Posts: 49
Joined: Thu Sep 10, 2015 7:51 pm
Has thanked: 4 times
Been thanked: 0 time

Re: SYNCSORT when=group end condition with multiple end rec

Postby NicC » Wed Nov 23, 2016 11:39 pm

How about trying the Syncsort manual as it is a Syncsort feature?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post