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 ...
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...