Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reformat multiple records into single with occurences????

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Reformat multiple records into single with occurences????
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

Moderator


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

PostPosted: Thu May 23, 2013 9:21 pm    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Thu May 23, 2013 9:38 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Wed May 29, 2013 12:52 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed May 29, 2013 3:45 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us