View previous topic :: View next topic
Author
Message
gylbharat Active Member Joined: 31 Jul 2009Posts: 565 Location: Bangalore
Hi,
I have a requirement where I have a input file having 10 records each of 5 bytes. I want to write these 10 records to one row in the output file.
Example
Code:
INPUT:
AAAAA
12345
BBBBB
64321
CCCCC
FFFFF
QQQQQ
ZZZZZ
OUTPUT
AAAAA 12345 BBBBB 64321 CCCCC FFFFF QQQQQ ZZZZZ
Please let me know how can i achieve this using sysncsort?
Back to top
Escapa Senior Member Joined: 16 Feb 2007Posts: 1399 Location: IL, USA
Is input going to have only 10 records always?
What is the version of SYNCSORT you are using?
LRECL and RECFM of input and output files Please...
Back to top
gylbharat Active Member Joined: 31 Jul 2009Posts: 565 Location: Bangalore
Yes, the number of records will be constant.
SYNCSORT version - SYNCSORT FOR Z/OS 1.3.2.0RI
LRECL of INPUT file - 5
RECFM of INPUT file - FB
Output - LRECL - 80
RECFM FB
Back to top
sqlcode1 Active Member Joined: 08 Apr 2010Posts: 577 Location: USA
gylbharat,
If you haven't already got the solution then try below(tested on DFSort)...
Code:
//STEP0001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD YOUR INPUT FB/5
//OUT DD OUTPUT FB/80
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(89,1,CH) WITHEACH WITH(07,5) -
WITH(14,5) WITH(21,5) WITH(28,5) WITH(35,5) WITH(42,5) -
WITH(49,5) WITH(56,5) WITH(63,5) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,C'1')),
IFTHEN=(WHEN=(81,8,ZD,EQ,02),OVERLAY=(07:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,03),OVERLAY=(14:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,04),OVERLAY=(21:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,05),OVERLAY=(28:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,06),OVERLAY=(35:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,07),OVERLAY=(42:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,08),OVERLAY=(49:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,09),OVERLAY=(56:1,5)),
IFTHEN=(WHEN=(81,8,ZD,EQ,10),OVERLAY=(63:1,5))
OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
//SYSOUT DD SYSOUT=*
//*
Thanks,
Back to top
gylbharat Active Member Joined: 31 Jul 2009Posts: 565 Location: Bangalore
Thanks Sqlcode1.... I wanted to know how the same can be achieved without using ICETOOL and DFSORT ....
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Suggest you try the solution given and post back if there are problems.
Back to top
sqlcode1 Active Member Joined: 08 Apr 2010Posts: 577 Location: USA
gylbharat,
Well I only have DFSort installed at my shop but the posted solution "should" also work for Syncsort.
Quote:
I wanted to know how the same can be achieved without using ICETOOL and DFSORT ...
I am not sure if I understood this correctly but by this, if you meant using other functions, then DFSort has RESIZE function which one can use but I am not sure if Syncsort has similar function available. Only other way I can think of would using IFTHEN GROUP 9 times, and selecting last record.
Thanks,
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Have you tried running this with Syncsort?
What happened?
Back to top
Vasanthr New User Joined: 24 Jan 2011Posts: 21 Location: India
I tried the same JCl with syncsort . It worked perfectly
Back to top
Please enable JavaScript!