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

Merging records using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Premdev

New User


Joined: 05 Feb 2008
Posts: 24
Location: Coimbatore

PostPosted: Tue Aug 18, 2009 9:57 am
Reply with quote

Hi,

I have records like this.

FM3SC
RNSC325739

I want to merge this as below with spaces in between.

FM3SC RNSC325739

Is this possible in DFSORT? Anyone pls help me to achieve this.

Thanks in advance.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 1:07 pm
Reply with quote

You have to explain more..

Do you want all records from your first file to one record i output file?
if this is the case how many records can be present in the file?

or

is there any key based on that all matching key records you want to merge as one (but dont see key in example given icon_question.gif )
if this is the case how many maximum duplicates for key can present in the file?
Back to top
View user's profile Send private message
Premdev

New User


Joined: 05 Feb 2008
Posts: 24
Location: Coimbatore

PostPosted: Tue Aug 18, 2009 1:29 pm
Reply with quote

No...

FM3SC is a form name and RNSC325739 is the code corresponding to that form.

I have a file like this.

FM4051
RN00169597
FM4052
RN06342555
FM1SC
RNSC111004
.
.
.


And i want this to be

FM4051 RN00169597
FM4052 RN06342555
FM1SC RNSC111004
.
.
.
.

Thanks & Regards,
Prema.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 2:17 pm
Reply with quote

Hi Prema,

will the form name is going to start with FM always?
Back to top
View user's profile Send private message
Premdev

New User


Joined: 05 Feb 2008
Posts: 24
Location: Coimbatore

PostPosted: Tue Aug 18, 2009 2:39 pm
Reply with quote

Yes... and the Code will start with RN always...
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 2:48 pm
Reply with quote

Below STEP will give you desired result..
Note that here I have assumed there will be only one RN record after FM record.
Code:

//S1    EXEC  PGM=SORT                                         
//SYSOUT    DD  SYSOUT=*                                       
//SORTMSG    DD  SYSOUT=*                                       
//SORTIN DD *                                                   
FM4051                                                         
RN00169597                                                     
FM4052                                                         
RN06342555                                                     
FM1SC                                                           
RNSC111004                                                     
/*                                                             
//SYSOUT   DD SYSOUT=*                                         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'FM'),             
                           PUSH=(11:1,6,SEQ=1))                 
  OUTFIL FNAMES=SORTOUT,OMIT=(17,1,ZD,EQ,1),BUILD=(11,6,X,1,10)


Output:
Code:

FM4051 RN00169597
FM4052 RN06342555
FM1SC  RNSC111004
Back to top
View user's profile Send private message
Premdev

New User


Joined: 05 Feb 2008
Posts: 24
Location: Coimbatore

PostPosted: Tue Aug 18, 2009 2:58 pm
Reply with quote

Thank you ji...
But im getting syntax err ... icon_cry.gif

Code:

 SORT FIELDS=COPY                                             
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'FM'),           
                    $                                         
SYNTAX ERROR                                                 
                          PUSH=(11:1,6,SEQ=1))               
                          $                                   
STATEMENT DEFINER ERROR                                       
 OUTFIL FNAMES=SORTOUT,OMIT=(17,1,ZD,EQ,1),BUILD=(11,6,X,1,10)
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 3:10 pm
Reply with quote

I guess you don't have DFSORT V1R5 PTF UK90013 (July, 2008).
That PTF is required to use WHEN=GROUP. Ask your System Programmer to install that PTF
Back to top
View user's profile Send private message
Premdev

New User


Joined: 05 Feb 2008
Posts: 24
Location: Coimbatore

PostPosted: Tue Aug 18, 2009 3:14 pm
Reply with quote

Any more option other than this pls?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 3:20 pm
Reply with quote

DFSORT V1R5 PTF UK90013 (July, 2008) is free...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 18, 2009 7:42 pm
Reply with quote

Hello,

When posting disgnostic information, message ids must be posted along with the text. . .
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 9:25 pm
Reply with quote

Hi Premdev
Refer solution given by Kolusu at below thread
ibmmainframes.com/viewtopic.php?t=43153
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Aug 18, 2009 9:37 pm
Reply with quote

Premdev,

Or even this one.
Code:
//STEP1    EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN       DD *                                                 
FM4051                                                           
RN00169597                                                       
FM4052                                                           
RN06342555                                                       
FM1SC                                                           
RNSC111004                                                       
//OUT      DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
  SPLICE FROM(IN) TO(OUT) ON(21,8,CH) WITH(11,10) USING(CTL1)   
//CTL1CNTL DD *                                                 
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'FM'),OVERLAY=(21:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,BUILD=(11:1,10,21:SEQNUM,8,ZD))       
  OUTFIL FNAMES=OUT,BUILD=(1,20) 
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top