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
 

 

Syncsort - Groupwise concatenate the record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Groupwise concatenate the record
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    Post subject:
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    Post subject:
Reply with quote

Hey Hi
Refer to this link
http://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    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 10, 2009 2:04 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 10, 2009 2:25 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Jul 10, 2009 8:26 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Jul 13, 2009 3:17 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Jul 13, 2009 3:37 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Jul 14, 2009 12:07 am    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 6 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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