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

Reformat multiple records into single with occurences????


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

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Thu May 23, 2013 9:03 pm
Reply with quote

Hello there. I was curious if it's possible to reformat multiple records with the same key into single one using ICETOOL?

Input file has multiple records with the same key (they can change). No more than 25 records per key.

Output file will have single record per key with occurences (25)

I also need to populate counter on record on output record in position 15

Input file:
Code:
---+----1----+----2----+----3----+----4----+----5
AAAA00001         R01X001                       
AAAA00001         R01X002                       
AAAA00222         R02X001                       
AAAA00222         R02X002                       
AAAA00222         R02X003                       
AAAA33333         R03X001                       
AAAA33333         R03X002                       
AAAA33333         R03X003                       
AAAA33333         R03X004                       
AAAA33333         R03X005                       


Outpu file will be like this:
Code:
----+----1----+----2----+----3----+----4----+----5----+--
AAAAA00001    002  R01X001 R01X002                       
AAAAA00222    003  R02X001 R02X002 R02X003               
AAAAA33333    005  R03X001 R03X002 R03X003 R03X004 R03X004       


If it's possible maybe somebody has similar code to show me.
Thank you very much in advance.....
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Thu May 23, 2013 9:21 pm
Reply with quote

what is the DFSORT version installed in your shop?
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Thu May 23, 2013 9:30 pm
Reply with quote

Pandora-Box wrote:
what is the DFSORT version installed in your shop?

icon_redface.gif SYNCSORT FOR Z/OS 1.4.0.1R
Is it a problem?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Thu May 23, 2013 9:38 pm
Reply with quote

SYNCSORT should always be posted in JCL Forum

Problem is I am not sure of something similar to RESIZE exists in SYNCSORT
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed May 29, 2013 12:52 pm
Reply with quote

rmd3003,

With Syncsort 1.3.2, you can achieve this using the below card.
Code:
//SYSIN   DD *                                                   
    INREC IFTHEN=(WHEN=INIT,
                  OVERLAY=(51:SEQNUM,3,ZD,RESTART=(1,10))),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,01),
          PUSH=(056:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,02),END=(51,3,ZD,EQ,1),
          PUSH=(064:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,03),END=(51,3,ZD,EQ,1),
          PUSH=(072:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,04),END=(51,3,ZD,EQ,1),
          PUSH=(080:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,05),END=(51,3,ZD,EQ,1),
          PUSH=(088:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,06),END=(51,3,ZD,EQ,1),
          PUSH=(096:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,07),END=(51,3,ZD,EQ,1),
          PUSH=(104:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,08),END=(51,3,ZD,EQ,1),
          PUSH=(112:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,09),END=(51,3,ZD,EQ,1),
          PUSH=(120:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,10),END=(51,3,ZD,EQ,1),
          PUSH=(128:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,11),END=(51,3,ZD,EQ,1),
          PUSH=(136:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,12),END=(51,3,ZD,EQ,1),
          PUSH=(144:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,13),END=(51,3,ZD,EQ,1),
          PUSH=(152:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,14),END=(51,3,ZD,EQ,1),
          PUSH=(160:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,15),END=(51,3,ZD,EQ,1),
          PUSH=(168:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,16),END=(51,3,ZD,EQ,1),
          PUSH=(176:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,17),END=(51,3,ZD,EQ,1),
          PUSH=(184:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,18),END=(51,3,ZD,EQ,1),
          PUSH=(192:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,19),END=(51,3,ZD,EQ,1),
          PUSH=(200:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,20),END=(51,3,ZD,EQ,1),
          PUSH=(208:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,21),END=(51,3,ZD,EQ,1),
          PUSH=(216:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,22),END=(51,3,ZD,EQ,1),
          PUSH=(224:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,23),END=(51,3,ZD,EQ,1),
          PUSH=(232:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,24),END=(51,3,ZD,EQ,1),
          PUSH=(240:20,7)),
          IFTHEN=(WHEN=GROUP,BEGIN=(51,3,ZD,EQ,25),END=(51,3,ZD,EQ,1),
          PUSH=(248:20,7)),
          IFTHEN=(WHEN=(51,3,ZD,EQ,1),OVERLAY=(64:191X))
     SORT FIELDS=COPY
     OUTFIL REMOVECC,NODETAIL,BUILD=(138X),
     SECTIONS=(1,10,TRAILER3=(1,10,15:51,124))

EDITed to handle all input scenarios - Arun
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed May 29, 2013 3:45 pm
Reply with quote

Hi,

minor detail
Code:
AAAAA33333    005  R03X001 R03X002 R03X003 R03X004 R03X004       


should be
Code:
AAAAA33333    005  R03X001 R03X002 R03X003 R03X004 R03X005       



Gerry
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 rexx pgm to create multiple ps file IBM Tools 7
No new posts Print report for each record from mul... CA Products 1
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts Syncsort- Merging two records into on... SYNCSORT 3
No new posts How to find orphaned MCDS D records. JCL & VSAM 18
Search our Forums:

Back to Top