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
 

 

Merging records using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Merging records using DFSORT
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Tue Aug 18, 2009 7:42 pm    Post subject:
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    Post subject:
Reply with quote

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

Moderator


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

PostPosted: Tue Aug 18, 2009 9:37 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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