|
View previous topic :: View next topic
|
| Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi, All
I want to groupwise concatenate the record.My input dataset has disposition as RECF=FB and LRECL=80
Input
User Key Level Value <--- Only for reference not in actual dataset
U1 P1 L1 A1
U1 P1 L2 A2
U1 P1 L3 A3
U1 P2 L1 A4
U1 P2 L2 A2
U1 P3 L1 A1
I want the output in below format
Output
U1 P1 L1 A1 L2 A2 L3 A3
U1 P2 L1 A4 L2 A2
U1 P3 L1 A1
U1 is of 2 byte character field.
P1 is a 10 byte character field.
L1 is 2 byte character field.
A1 is a 10 byte character field.
There is no restriction on the output dataset.L1 can have 10 values from 01 to 10. Key is of 10 character long.Value is 8 byte long.
The actual key to be used is User+Key.
Can we do using DFSORT. Please help me.
Please let me know if some more input is required.
Thanks in Advance. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Quote: |
U1 is of 2 byte character field.
P1 is a 10 byte character field.
|
What will be maximum occurance of this combination..
Here in example you have shown us,its 3
can we assume it that it will be three? |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Thank You, Sambhaji for your quick reply
The solution that you have provided is done using icetool not with dfsort.
Can we do this using DFSORT not with ICETOOL.
Thanks,
Rahul Gupta |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
why not use the ICETOOL component of DFSORT,
which comes with DFSORT? |
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
The reason is very simple, no one among us uses ICETOOL .
Someone told me that we are not allowed to use ICETOOL. I don't know the reason for this.
Thanks,
Rahul Gupta |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| Quote: |
| The reason is very simple, no one among us uses ICETOOL . |
And that's a valid reason ??? |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Quote: |
Someone told me that we are not allowed to use ICETOOL. I don't know the reason for this.
|
And you believed??  |
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
No,its not a valid reason.
Someone told me that there is some extra cost involved when we use ICETOOL,expeditor etc.
Please let me know that some extra cost is incurred while using ICETOOL or not.
Thanks,
Rahul Gupta |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| ICETOOL is a part of the DFSORT product, so if you have DFSORT you have ICETOOL. |
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
| Thank You expat. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
rgupta71,
The following DFSORT JCL will give you the desired results. I assumed the following
1. The file is already sorted on the KEY (first 12 bytes - U1+P1 )
2. You can have a max of 10 duplicates per key combo
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+
U1 P1L1 A01
U1 P1L2 A02
U1 P1L3 A03
U1 P1L4 A04
U1 P1L5 A05
U1 P1L6 A06
U1 P1L7 A07
U1 P1L8 A08
U1 P1L9 A09
U1 P1L0 A10
U1 P2L1 A4
U1 P2L2 A2
U1 P3L1 A1
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,12,133:SEQNUM,2,ZD,RESTART=(1,12),13,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,1),RECORDS=10,
PUSH=(013:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,2),RECORDS=09,
PUSH=(025:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,3),RECORDS=08,
PUSH=(037:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,4),RECORDS=07,
PUSH=(049:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,5),RECORDS=06,
PUSH=(061:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,6),RECORDS=05,
PUSH=(073:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,7),RECORDS=04,
PUSH=(085:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,8),RECORDS=03,
PUSH=(097:135,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,9),RECORDS=02,
PUSH=(109:135,12)),
IFTHEN=(WHEN=(133,2,ZD,EQ,10),OVERLAY=(121:135,12))
OUTFIL REMOVECC,NODETAIL,BUILD=(132X),
SECTIONS=(1,12,TRAILER3=(1,132))
/* |
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| Please let me know that some extra cost is incurred while using ICETOOL or not. |
Not. There's no extra cost. |
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Thanks Kolusu
1 last question
can u plz explain me the significance of 133.
my o/p length 255. What value should I use instead of 133
Thanks |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| rgupta71 wrote: |
Thanks Kolusu
1 last question
can u plz explain me the significance of 133.
my o/p length 255. What value should I use instead of 133
Thanks |
Why would you have a length of 255? You said you have a max of 10 occurrence per key combination and the total length of the fields you want to merge is 12 . so 10X12 = 120 bytes and then you have the key which is 12 bytes. So the total is 120 + 12 = 132 bytes. Why would you want to have 255 bytes as output when the data is only 132 bytes long? |
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi,Frank
The above code is giving an error
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,12,133:SEQNUM,2,ZD,RESTART=(1,12),13,12)),
IFTHEN=(WHEN=GROUP,BEGIN=(133,2,ZD,EQ,1),RECORDS=10,
*
The * sign is below group
The msg that was in sysout was
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Please help me in solving this query.
Thanks and Regards
Rahul Gupta |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Rahul,
your error messages belong to SYNCSORT not DFSORT.
WER - SYNCSORT messages
ICE - DFSORT messages
Both Frank and Skolusu are DFSORT developers, SYNCSORT is the opposition.
When seeking help be sure you mention the correct product.
Gerry |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Rahul,
as for GROUP, SYNCSORT supports it but you do not have the latest version of SYNCSORT.
Gerry |
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Thanks Gerry!
Can I conclude from the above discussion that I cannot achieve my required output using SYNCSORT.
Thanks and Regards
Rahul Gupta |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
The current release of Syncsort supports WHEN=GROUP. . .
Syncsort topics should be posted in the JCL part of the forum. . . |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Quote: |
Can I conclude from the above discussion that I cannot achieve my required output using SYNCSORT.
|
rgupta71,
AFAIK, there's no extra cost for using a SYNCTOOL solution too. But before that you might want to answer the below question raised by Kolusu.
| Skolusu wrote: |
| Why would you have a length of 255? You said you have a max of 10 occurrence per key combination and the total length of the fields you want to merge is 12 . so 10X12 = 120 bytes and then you have the key which is 12 bytes. So the total is 120 + 12 = 132 bytes. Why would you want to have 255 bytes as output when the data is only 132 bytes long? |
|
|
| Back to top |
|
 |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
The reson for using LRECL=255 was the input file .
The input file that I used to test the job was already having LRECL=133.
So, instead of creating a new dataset to test the job I used already exsisting dataset that met the same criteria.
Please let me know if I have missed something.
Thanks,
Rahul Gupta |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|