Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 46

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: 7223

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: 46

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: 7223

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: 46

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: 46

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 Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts GROUP - header data to be repeated in... Musab Ahmed DFSORT/ICETOOL 3 Mon Feb 01, 2016 11:36 am
No new posts Append to file, but also remove old r... Garry Carroll JCL & VSAM 3 Mon Jan 25, 2016 8:05 pm
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am
No new posts Syncsort to remove the leading spaces V S Amarendra Reddy SYNCSORT 5 Fri Jan 08, 2016 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us