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

Repeating unique id for next particular set of rows


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Thu Oct 03, 2013 4:43 am
Reply with quote

Hi

My Input looks like:

Code:
1           12                     30
-----------------------------------
74.02    AW8791            XXXXXXXXXXXXXXX
                                      XXXXXXXXXXXXXXX
                                      XXXXXXXXXXXXXXX
                                      XXXXXXXXXXXXXXX
         1004215735        XXXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX
                                         
67.53    W23435           XXXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX
                                     
                                     XXXXXXXXXXXXXXX
         1004162939        XXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX
                                     XXXXXXXXXXXXXXX

My expected out put is

Code:
1           12                     30
-----------------------------------
             AW8791           XXXXXXXXXXXXXXX
             AW8791           XXXXXXXXXXXXXXX
             AW8791           XXXXXXXXXXXXXXX
             AW8791           XXXXXXXXXXXXXXX
             1004215735    XXXXXXXXXXXXXXX
             1004215735    XXXXXXXXXXXXXXX
             1004215735    XXXXXXXXXXXXXXX
             1004215735    XXXXXXXXXXXXXXX
                                         
             W23435           XXXXXXXXXXXXXXX
             W23435           XXXXXXXXXXXXXXX
             W23435           
             W23435           XXXXXXXXXXXXXXX
             1004162939    XXXXXXXXXXXXXXX
             1004162939    XXXXXXXXXXXXXXX
             1004162939    XXXXXXXXXXXXXXX
             1004162939    XXXXXXXXXXXXXXX

Each group has eight rows followed by spaces with 2 unique id. So each unique id starting from position 12 needs to be printed for next 3 lines in same position

I tried using some function using sort but no got.

Please suggest
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Oct 03, 2013 4:48 am
Reply with quote

Look at the smart DFSORT trick "Include or omit groups of records" to use WHEN=GROUP and remove the INCLUDE on OUTFIL and use BUILD to get the required output.

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Sat Oct 05, 2013 4:09 am
Reply with quote

Thank you Skolusu...

I used below sort card

SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(12,1,CH,NE,C' '),
PUSH=(283:ID=8))
OUTREC BUILD=(1,290)


It worked well.


Thanks,
Lagnesh.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Oct 05, 2013 4:49 am
Reply with quote

Thanks for letting us know and showing what you used.

What happened when you run your sample input? Don't you need to do something with the blank lines?

If you actually only have four records in each group, for certain, you can also consider RECORDS=4 on the WHEN=GROUP, which will leave the blank lines (if there are any) undisturbed.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts How to compare two rows of same table DB2 11
Search our Forums:

Back to Top