View previous topic :: View next topic
Author
Message
sunnybunny New User Joined: 29 Nov 2005Posts: 49
Hi,
Can anyone helpme on this please.
I have two input files say A & B.
File A: Date file (with two dates YYYYMMDD format) with length of 16 bytes.
Ex: 2009050120090615
File B: Data file with length of 102 bytes.
Ex: 9991111222222000000000000000000000000000000
My requirement is, I have to generate an output file with following format by using SYNCSORT.
The date 20090615 in first file should be concatenated to second file in last 8 positions as i mentioned in the below format.
9991111222222000000000000000000000020090615
Please provide me the SORT card for this.
Thanks in advance
Sunny.
Back to top
deepuvja New User Joined: 06 Mar 2008Posts: 5 Location: chennai
I am assuming that
1.There is single record in both files.
2.LRECL of the date file is 16 and the next one is 102 AND BOTH ARE fB
3.Output of the sort operation is of 110 LRECL.
4.I am using ICETOOL which comes with syncsort product usually
Code:
//MYIDNRES JOB (*****,*),
// 'DEEPAK TEST',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//VIN DD DSN=MYID.TEMP.TEST1,DISP=SHR
//EXT DD DSN=MYID.TEMP.TEST2,DISP=SHR
//T0 DD DSN=&&T0,UNIT=SYSDA,SPACE=(CYL,(700,1700)),DISP=(MOD,PASS)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(700,1700)),DISP=(MOD,PASS)
//OUT DD DSN=MYID.TEMP.TEST3,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(700,1700),RLSE)
//TOOLIN DD *
COPY FROM(EXT) TO(T0) USING(CTL0)
COPY FROM(VIN) TO(T0) USING(CTL1)
SPLICE FROM(T0) TO(T1) ON(111,8,PD) -
WITH(103,8)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL0CNTL DD *
OPTION EQUALS
INREC OVERLAY=(1,102,111:SEQNUM,8,PD)
/*
//CTL1CNTL DD *
OPTION EQUALS
OUTREC FIELDS=(1:102X,103:1,8,111:SEQNUM,8,PD)
/*
//CTL2CNTL DD *
OPTION EQUALS
OUTREC FIELDS=(1,110)
/*
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
Hi Sunny.
Assuming that there is a single record in the DATE file, here is a SyncSort for z/OS job that will do what you asked:
Code:
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=DATA.RECORDS
//SORTOUT DD DISP=(NEW,PASS),DSN=&&TEMP1
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(103:C'1')
//*****************************************
//STEP2 EXEC PGM=SORT
//SORTIN DD DSN=DATE.FILE
//SORTOUT DD DISP=(NEW,PASS),DSN=&&TEMP2
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(17:C'1')
//*****************************************
//STEP3 EXEC PGM=SORT
//SORTJNF1 DD DSN=&&TEMP1,DISP=(OLD,DELETE)
//SORTJNF2 DD DSN=&&TEMP2,DISP=(OLD,DELETE)
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(103,1,A)
JOINKEYS FILES=F2,FIELDS=(17,1,A)
REFORMAT FIELDS=(F1:1,102,F2:9,8)
SORT FIELDS=COPY
/*
Back to top
deepuvja New User Joined: 06 Mar 2008Posts: 5 Location: chennai
In my earlier reply
VIN is the date file
EXT is the data file.
Sorry for missing naming conven..
Back to top
sunnybunny New User Joined: 29 Nov 2005Posts: 49
Hi Deepu,
Thanks for your reply.
ICETOOL is not working in my environment. But anyway thanks for giving the solution.
Regards,
Sunny.
Back to top
sunnybunny New User Joined: 29 Nov 2005Posts: 49
Hi Alissa,
Thank you so much for your solution.
The solution that you gave me is working fine.
Thanks for your help.
Regards,
Sunny.
Back to top
Please enable JavaScript!