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

Merging lines


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

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Mon Nov 04, 2019 10:57 pm
Reply with quote

Good afternoon

I have an input file where the data is grouped.
Would like to bring to discussion any approach to have the data moved to the same line using DFSort.
The amount of lines in each group may vary randomly (200 bytes length max).

I think the main issue is that i don't see a way to use the "RESISE FROM(IN) TO(OUT) TOLEN(200) because the groups of data will vary the amount of lines.

Any ideas please ?

In (FB80)
Code:
    AAAAAAA  Mainframes have high
       availability, one of the
    GGGG  primary reasons for their
       longevity, since they are
    AAAAAAA  typically used in applications
       where downtime would be
       costly or catastrophic.
    GGGG  In the late 1950s, mainframes
       had only a rudimentary
       interactive interface
       (the console), and used sets of ...
       
       
       
       


Out
Code:

    AAAAAAA  Mainframes have high availability, one of the
    GGGG  primary reasons for their longevity, since they are
    AAAAAAA  typically used in applications where downtime would be costly or catastrophic.
    GGGG  In the late 1950s, mainframes had only a rudimentary interactive interface (the console), and used sets of ...
   
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Tue Nov 05, 2019 2:04 am
Reply with quote

The operation MERGE in SORT utilities has completely different meaning from what you need.

Please, remove the word MERGE from your post.
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Tue Nov 05, 2019 2:55 am
Reply with quote

what subject do you suggest ?

In addition... any idea to approach the issue ?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Nov 05, 2019 2:55 am
Reply with quote

Try SPLICE
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Nov 06, 2019 1:26 am
Reply with quote

In general, SORT products are not supposed to concatenate multiple records of the same dataset into single record, neither in full, nor in parts.

Using some tricks this can be done, with restrictions.

For instance, if the maximum number of lines concatenated into one single line is limited to a reasonable value, the following approach might work.

Code:
//CONCAT   EXEC PGM=SORT                       
//*                                             
//SYSOUT   DD  SYSOUT=*                         
//*                                             
//SORTIN   DD  *                               
    AAAAAAA  mainframes have high               
       availability, one of the                 
    GGGG  primary reasons for their             
       longevity, since they are               
    AAAAAAA  typically used in applications     
       where downtime would be                 
       costly or catastrophic.                 
    GGGG  in the late 1950s, mainframes         
       had only a rudimentary                   
       interactive interface                   
       (the console), and used sets of ...     
//SORTOUT  DD  SYSOUT=*                         
//*                                             
//SYSIN    DD  *                               
 INREC IFTHEN=(WHEN=GROUP,                     
               BEGIN=(1,7,CH,NE,C' '),         
               PUSH=(1:SEQ=4))                 
*                                               
 SORT FIELDS=COPY                               
*                                               
 OUTREC IFTHEN=(WHEN=GROUP,                     
               BEGIN=(1,4,ZD,EQ,+1),           
               PUSH=(091:5,80)),               
       IFTHEN=(WHEN=GROUP,                     
               BEGIN=(1,4,ZD,EQ,+2),           
               PUSH=(171:5,80)),               
       IFTHEN=(WHEN=GROUP,                     
               BEGIN=(1,4,ZD,EQ,+3),           
               PUSH=(251:5,80)),               
       IFTHEN=(WHEN=GROUP,                     
               BEGIN=(1,4,ZD,EQ,+4),           
               PUSH=(331:5,80)),               
       IFTHEN=(WHEN=GROUP,                     
               BEGIN=(1,4,ZD,EQ,+5),           
               PUSH=(411:5,80)),                             
       IFTHEN=(WHEN=(1,4,ZD,LE,+5),                           
               BUILD=(91,400,SQZ=(SHIFT=LEFT,MID=C' ')))     
*                                                             
 OUTFIL REMOVECC,NODETAIL,                                   
        SECTIONS=(1,8,                                       
        TRAILER3=(1,400))                                     
//*

Code:
********************************* TOP OF DATA **********************************
AAAAAAA mainframes have high availability, one of the                           
GGGG primary reasons for their longevity, since they are                       
AAAAAAA typically used in applications where downtime would be costly or catastr. . . . . . . . . .
GGGG in the late 1950s, mainframes had only a rudimentary interactive interface. . . . . . . . . . . . . . 
******************************** BOTTOM OF DATA ********************************


But this way is a sort of workaround. We know for sure that there is a lot of fish in the sea. For this specific task using REXX code would be much more preferable, and flexible compared to any SORT/ICETOOL... icon_exclaim.gif
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 Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts I need a 4 lines block where substrin... DFSORT/ICETOOL 12
No new posts Copy few lines from SYSOUT of 10 mill... All Other Mainframe Topics 5
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts Merge 2 lines based on Space from a S... DFSORT/ICETOOL 5
Search our Forums:

Back to Top