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

Remove header only


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Mon Feb 15, 2016 10:42 pm
Reply with quote

Hello i have FB LRECL=1000 file with 100k lines.
Every 50 lines it has 2 lines with column headers (same 2 lines for entire file).
I would like to keep all the data and the only 2 first header lines.
Could you please suggest any way to do this with syncsort?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 15, 2016 10:54 pm
Reply with quote

Well, depending on your data, OMIT COND=
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Mon Feb 15, 2016 11:04 pm
Reply with quote

but how can u omit cond all headers except the first 2 ?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 15, 2016 11:29 pm
Reply with quote

OK, you use IFTHEN=(WHEN=(logicalexpression) to set a SEQNO in a temporary extension to the record.

Then on OUTFIL you use OMIT= for the sequence-number field being greater than two. Use BUILD to return the records to their original size.
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Tue Feb 16, 2016 2:52 am
Reply with quote

i think i'm missing something here..... below are my code...
For some reason, when checking the seqnum after the job run (temp file), it says that the first line is the 00000001 ... so i assume my inrec is processed after the omit.... this causes the out file to be generated without any header. any thoughts to bypass this ?


Code:


//SYSIN *
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(260:SEQNUM,8,ZD))

 OMIT COND=((01,80,SS,EQ,C'HEADER I DONT WANT1'),OR,
            (01,80,SS,EQ,C'HEADER I DONT WANT2'),OR,
            (01,80,SS,EQ,C'HEADER I DONT WANT3'),OR,
            (01,80,SS,EQ,C'HEADER I DONT WANT4'),OR,
            (01,20,CH,EQ,C'HEADER I DONT WANT5'),OR,
            (01,30,SS,EQ,C'HEADER I DONT WANT6'),OR,

       ((01,10,SS,EQ,C'HEADKEEP1'),AND,
                    (260,8,ZD,NE,00000001)),OR,


       ((20,40,SS,EQ,C'HEADKEEP2'),AND,
                    (260,8,ZD,NE,00000002)))


 SORT FIELDS=COPY
//


  OUTREC BUILD=(1,250)
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Tue Feb 16, 2016 3:19 am
Reply with quote

i think i got it... just changing omit cond to outfil omit.... thanks a lot Bill !
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Remove leading zeroes SYNCSORT 4
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
Search our Forums:

Back to Top