Portal | 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

Moderator Emeritus


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

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

Moderator Emeritus


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

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 How to remove this shortcut bar? CoboleiroBr TSO/ISPF 3 Tue Jul 14, 2020 7:12 pm
No new posts How to remove remote file older than ... ssuthagar All Other Mainframe Topics 4 Thu Jun 04, 2020 6:26 am
No new posts Insert System Runtime in HEADER In SY... Rick Ryan SYNCSORT 9 Tue May 26, 2020 9:01 pm
No new posts Create Header Dtae as MMDDYYYY thesumitk DFSORT/ICETOOL 16 Tue Feb 25, 2020 4:56 pm
No new posts How to include header and some detail... AllyDick DFSORT/ICETOOL 2 Sun Dec 08, 2019 10:19 pm

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