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

SYNCSORT MERGE


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Tue Dec 30, 2008 11:57 am
Reply with quote

I'm in need of some help on merge, the details are given below.
Both the input datasets SORTIN01,SORTIN02 have headers, I want to skip the header present in SORTIN02 while merging (so that only 1 header is present in output file). Is there any way to skip the 1st record from the SORTIN02 dataset
(my system analyst is not ready to use an additonal step that OMIT the header and use the output file in the below step)

Code:

//STEP0025 EXEC PGM=SYNCSORT                                         
//SYSOUT   DD SYSOUT=*                                   
//SORTIN01 DD DSN=DATASET1,DISP=OLD
//SORTIN02 DD DSN=DATASET2,DISP=OLD
//*                                                               
//SORTOUT  DD DSN=DATASET3,     
//            DISP=(,PASS,DELETE),                             
//            SPACE=(TRK,(400,900),RLSE)
//SYSIN DD *                                                       
  MERGE FIELDS=(1,13,CH,A)                                         
/*                                                                 
//*         


Thanks
Prasad
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Dec 30, 2008 1:42 pm
Reply with quote

sivatechdrive
Is there a way that you can distinguish between the header records and the detail records?

What is LRECL and RECFM of both the files?
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Tue Dec 30, 2008 2:49 pm
Reply with quote

For Both the Files the LRECL is 110 and RECFM is F (Fixed)
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Dec 30, 2008 5:59 pm
Reply with quote

sivatechdrive

You havent answered my first question
Quote:
Is there a way that you can distinguish between the header records and the detail records?
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Wed Dec 31, 2008 10:43 am
Reply with quote

from 1-6 positions The Header records will be '000000'
and for the detail records from position 1-6 it will be not zeros
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jan 02, 2009 9:19 pm
Reply with quote

sivatechdrive,

This might be of some help to you.
Code:
//STEP00  EXEC PGM=SORT                                             
//SORTIN01  DD DISP=SHR,DSN= Input-1 , FB/LRECL=110                 
//SORTIN02  DD DISP=SHR,DSN= Input-2 , FB/LRECL=110                 
//SORTOUT   DD DISP=SHR,DSN= Output  , FB/LRECL=110                 
//SYSOUT    DD SYSOUT=*                                             
//SYSIN     DD *                                                   
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(111:C'1')),                       
       IFTHEN=(WHEN=(1,6,CH,EQ,C'000000'),OVERLAY=(111:SEQNUM,1,ZD))
 MERGE FIELDS=(1,13,CH,A)                                           
 OUTFIL BUILD=(1,110),INCLUDE=(111,1,CH,EQ,C'1')                   
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Jan 02, 2009 10:14 pm
Reply with quote

Arun's solution can be simplified slightly as follows:

Code:
//SYSIN     DD *                                                   
   INREC IFTHEN=(WHEN=(1,6,CH,EQ,C'000000'),OVERLAY=(111:SEQNUM,1,ZD))
   MERGE FIELDS=(1,13,CH,A)                                           
   OUTFIL BUILD=(1,110),OMIT=(111,1,CH,GT,C'1')   
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Tue Jan 06, 2009 10:48 am
Reply with quote

Hi arcvns & Alissa Margulies,

Thanks a lot for the reply. My problem is resolved

Happy new year





Thanks
Prasad
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 06, 2009 10:56 am
Reply with quote

Prasad,

You're welcome. Wish u the same.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Jan 06, 2009 8:51 pm
Reply with quote

Prasad,

Thanks for letting us know. Happy New Year to you, as well.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Merge 2 input files after sort SYNCSORT 14
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top