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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 190
Location: hyderabad

PostPosted: Tue Dec 30, 2008 11:57 am    Post subject: SYNCSORT MERGE
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    Post subject:
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: 190
Location: hyderabad

PostPosted: Tue Dec 30, 2008 2:49 pm    Post subject: Reply to: SYNCSORT MERGE
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    Post subject:
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: 190
Location: hyderabad

PostPosted: Wed Dec 31, 2008 10:43 am    Post subject: Reply to: SYNCSORT MERGE
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: 2285
Location: @my desk

PostPosted: Fri Jan 02, 2009 9:19 pm    Post subject:
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: 500
Location: USA

PostPosted: Fri Jan 02, 2009 10:14 pm    Post subject:
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: 190
Location: hyderabad

PostPosted: Tue Jan 06, 2009 10:48 am    Post subject:
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: 2285
Location: @my desk

PostPosted: Tue Jan 06, 2009 10:56 am    Post subject:
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: 500
Location: USA

PostPosted: Tue Jan 06, 2009 8:51 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am

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