Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Remove header only

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
knobi

New User


Joined: 16 Aug 2005
Posts: 53

PostPosted: Mon Feb 15, 2016 10:42 pm    Post subject: Remove header only
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Mon Feb 15, 2016 10:54 pm    Post subject: Reply to: remove header only
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: 53

PostPosted: Mon Feb 15, 2016 11:04 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Mon Feb 15, 2016 11:29 pm    Post subject: Reply to: remove header only
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: 53

PostPosted: Tue Feb 16, 2016 2:52 am    Post subject:
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: 53

PostPosted: Tue Feb 16, 2016 3:19 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm
No new posts User key common area users - How to r... vasanthz All Other Mainframe Topics 0 Thu Oct 10, 2019 1:17 am
No new posts IEBGENER to copy from FB to VB and re... Mike.Fulton All Other Mainframe Topics 3 Sat Aug 24, 2019 7:20 am
No new posts Header and trailer for a PS file kumara kanthirava JCL & VSAM 5 Mon Aug 19, 2019 3:54 pm
No new posts To remove the spaces using SORT Card dharmaraok DFSORT/ICETOOL 1 Tue Apr 30, 2019 3:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us