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

Syncsort - Groupwise concatenate the record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Jul 10, 2009 11:01 am
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Fri Jul 10, 2009 12:54 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Fri Jul 10, 2009 1:18 pm
Reply with quote

Hey Hi
Refer to this link
ibmmainframes.com/viewtopic.php?t=37626&highlight=merge+record
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Jul 10, 2009 1:50 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 10, 2009 1:56 pm
Reply with quote

why not use the ICETOOL component of DFSORT,
which comes with DFSORT?
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Jul 10, 2009 2:02 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 10, 2009 2:04 pm
Reply with quote

Quote:
The reason is very simple, no one among us uses ICETOOL .

And that's a valid reason ???
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Fri Jul 10, 2009 2:20 pm
Reply with quote

Quote:

Someone told me that we are not allowed to use ICETOOL. I don't know the reason for this.


And you believed?? icon_eek.gif
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Jul 10, 2009 2:24 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 10, 2009 2:25 pm
Reply with quote

ICETOOL is a part of the DFSORT product, so if you have DFSORT you have ICETOOL.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Jul 10, 2009 2:27 pm
Reply with quote

Thank You expat.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jul 10, 2009 8:12 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jul 10, 2009 8:26 pm
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Sat Jul 11, 2009 1:31 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jul 11, 2009 2:39 am
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Jul 13, 2009 2:34 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jul 13, 2009 3:17 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jul 13, 2009 3:37 pm
Reply with quote

Hi Rahul,

as for GROUP, SYNCSORT supports it but you do not have the latest version of SYNCSORT.



Gerry
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Jul 13, 2009 4:07 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jul 14, 2009 12:07 am
Reply with quote

Hello,

The current release of Syncsort supports WHEN=GROUP. . .

Syncsort topics should be posted in the JCL part of the forum. . .
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jul 14, 2009 2:38 am
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Wed Jul 15, 2009 4:01 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top