View previous topic :: View next topic
|
Author |
Message |
Premdev
New User
Joined: 05 Feb 2008 Posts: 24 Location: Coimbatore
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 )
if this is the case how many maximum duplicates for key can present in the file? |
|
Back to top |
|
|
Premdev
New User
Joined: 05 Feb 2008 Posts: 24 Location: Coimbatore
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Prema,
will the form name is going to start with FM always? |
|
Back to top |
|
|
Premdev
New User
Joined: 05 Feb 2008 Posts: 24 Location: Coimbatore
|
|
|
|
Yes... and the Code will start with RN always... |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
Premdev
New User
Joined: 05 Feb 2008 Posts: 24 Location: Coimbatore
|
|
|
|
Thank you ji...
But im getting syntax err ...
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
Premdev
New User
Joined: 05 Feb 2008 Posts: 24 Location: Coimbatore
|
|
|
|
Any more option other than this pls? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
DFSORT V1R5 PTF UK90013 (July, 2008) is free... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When posting disgnostic information, message ids must be posted along with the text. . . |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|