|
|
| Author |
Message |
chiru_sh
New User
Joined: 21 Feb 2008 Posts: 14 Location: Mumbai
|
|
|
|
I have two files like
File 1
11111111
File 2
22222222
I wanted to join two files in order to make it one. Like the below file
File3
1111 TO 2222
So had written syntax like this
| Code: |
//IN1 DD DSN=AP019.TEST.DATE1,DISP=SHR
//IN2 DD DSN=AP019.TEST.DATE2,DISP=SHR
//CTL1JNF1 DD DSN=AP019.TEST.NF1,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// VOL=SER=MODL03,SPACE=(TRK,(30,5),RLSE)
//CTL1JNF2 DD DSN=AP019.TEST.NF2,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// VOL=SER=MODL03,SPACE=(TRK,(30,5),RLSE)
//CTL3OF01 DD DSN=AP019.TEST.FTEMP,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// VOL=SER=MODL03,SPACE=(TRK,(30,5),RLSE)
//FTEMP DD DSN=AP019.TEST.FTEMP1,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// VOL=SER=MODL03,SPACE=(TRK,(30,5),RLSE)
//TOOLIN DD *
COPY FROM(IN1) TO(CTL1JNF1) USING(CTL1)
COPY FROM(IN2) TO(CTL1JNF2) USING(CTL2)
COPY FROM(CTL1JNF1) TO(FTEMP) USING(CTL3)
//OUT1 DD DSN=AP019.TEST.SORT1,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// VOL=SER=MODL03,SPACE=(TRK,(30,5),RLSE),
// DCB=(RECFM=FBA,LRECL=83,BLKSIZE=830)
//CTL1CNTL DD *
OUTREC FIELDS=(1,8,81:C'1')
/*
//CTL2CNTL DD *
OUTREC FIELDS=(10:C'TO ',13:1,8,81:C'1')
/*
//CTL3CNTL DD *
JOINKEYS FILES=F1,FIELDS=(81,1,A)
JOINKEYS FILES=F2,FIELDS=(81,1,A)
REFORMAT FIELDS=(F1:1,8,F2:9,72)
SORT FIELDS=COPY
|
But my output file looks like this
I am not able to understand where I am going wrong. Can anybody help me on this. |
|
| Back to top |
|
 |
References
|
|
 |
Moved: Wed Jun 25, 2008 4:58 pm by superk From DFSORT/ICETOOL to JCL |
Vasukip Currently Banned New User
Joined: 17 Jun 2008 Posts: 48 Location: Chennai
|
|
|
|
| Code: |
//S1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
11111111
/*
//IN2 DD *
22222222
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5,)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(20,2,CH)-
WITHALL WITH(11,4) USING(CTL2)
/*
//CTL1CNTL DD *
OPTION COPY
OUTREC FIELDS=(1:1,4,5:C' ',7:C'TO',9:C' ',
11:5,4,20:C'AA')
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,
INCLUDE=(20,1,CH,EQ,C'AA'),
BUILD=(1,19)
/*
|
Output
---------
1111 TO 2222
Please try this code , In your code you didnt specify SPLICE and also trying two different outputs. |
|
| Back to top |
|
 |
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 162 Location: hyderabad
|
|
|
|
Chiru,
Check the below code for SYNCSORT .
| Code: |
//PS020 EXEC PGM=SYNCTOOL
//SYSOUT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
11111111
33333333
55555555
//IN2 DD *
22222222
44444444
66666666
//CTL1JNF1 DD DSN=TEST.T1,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDK,
// SPACE=(TRK,(30,5),RLSE)
//CTL1JNF2 DD DSN=TEST.TEST.NF2,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDK,
// SPACE=(TRK,(30,5),RLSE)
//CTL1OF01 DD DSN=TEST.TEST.FTEMP,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDK,
// SPACE=(TRK,(30,5),RLSE),DCB=(RECFM=FB,LRECL=80)
//TOOLIN DD *
COPY FROM(IN1) TO(CTL1JNF1) USING(CTLA)
COPY FROM(IN2) TO(CTL1JNF2) USING(CTLB)
COPY FROM(CTL1JNF1) USING(CTL1)
//CTLACNTL DD *
OUTREC FIELDS=(1,4,81:SEQNUM,8,ZD)
/*
//CTLBCNTL DD *
OUTREC FIELDS=(C' TO ',1,4,81:SEQNUM,8,ZD)
/*
//CTL1CNTL DD *
JOINKEYS FILES=F1,FIELDS=(81,8,A)
JOINKEYS FILES=F2,FIELDS=(81,8,A)
REFORMAT FIELDS=(F1:1,4,F2:1,8)
SORT FIELDS=COPY
OUTFIL FILES=01,OUTREC=(1,12,80:X)
|
outout :
| Code: |
1111 TO 2222
3333 TO 4444
5555 TO 6666
|
|
|
| Back to top |
|
 |
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 133 Location: india
|
|
|
|
Hello chiru_sh,
I feel that easier and efficient approach for your requrement would be the below JCL:
| Code: |
//VZM1CKKN JOB (3GAHF3,R),
// 'RAJAT TEST',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID
//S1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
11111111
33333333
55555555
/*
//IN2 DD *
22222222
44444444
66666666
/*
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CTL1)
COPY FROM(IN2) TO(TMP1) USING(CTL2)
SPLICE FROM(TMP1) TO(OUT) ON(80,8,PD) WITH(6,7) USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,4,80:SEQNUM,8,PD)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(6:C'TO',X,9:1,4,80:SEQNUM,8,PD)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,14)
/* |
OUTPUT:
| Code: |
1111 TO 2222
3333 TO 4444
5555 TO 6666 |
Regards,
Rajat |
|
| Back to top |
|
 |
chiru_sh
New User
Joined: 21 Feb 2008 Posts: 14 Location: Mumbai
|
|
|
|
Hi Rajat,
| rajatbagga wrote: |
Hello chiru_sh,
I feel that easier and efficient approach for your requrement would be the below JCL:
| Code: |
//VZM1CKKN JOB (3GAHF3,R),
// 'RAJAT TEST',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID
//S1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
11111111
33333333
55555555
/*
//IN2 DD *
22222222
44444444
66666666
/*
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CTL1)
COPY FROM(IN2) TO(TMP1) USING(CTL2)
SPLICE FROM(TMP1) TO(OUT) ON(80,8,PD) WITH(6,7) USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,4,80:SEQNUM,8,PD)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(6:C'TO',X,9:1,4,80:SEQNUM,8,PD)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,14)
/* |
Regards,
Rajat |
Thanks. But it is giving me error.
| Code: |
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
SPLICE FROM(TMP1) TO(OUT) ON(80,4,CH) WITH(6,7) USING(CTL3)
SYT048E STATEMENT DOES NOT BEGIN WITH A VALID OPERATOR
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
|
Is it the prblem with SYNCSORT version
| Code: |
SYNCTOOL RELEASE 1.2 - COPYRIGHT 1993 SYNCSORT INC. |
|
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 244 Location: USA
|
|
|
|
| Quote: |
Is it the prblem with SYNCSORT version
| Code: |
SYNCTOOL RELEASE 1.2 - COPYRIGHT 1993 SYNCSORT INC. |
|
Could be. SPLICE support was included in SyncSort for z/OS 1.1 TPF3 and later. You posted the SYNCTOOL release, but which release of SyncSort are you running? |
|
| Back to top |
|
 |
chiru_sh
New User
Joined: 21 Feb 2008 Posts: 14 Location: Mumbai
|
|
|
|
| Alissa Margulies wrote: |
| Quote: |
Is it the prblem with SYNCSORT version
| Code: |
SYNCTOOL RELEASE 1.2 - COPYRIGHT 1993 SYNCSORT INC. |
|
Could be. SPLICE support was included in SyncSort for z/OS 1.1 TPF3 and later. You posted the SYNCTOOL release, but which release of SyncSort are you running? |
The following information I got about SYNCSORT. Please tell me if I can use SPLICE or JOIN KEYS.
| Code: |
SYNCSORT 3.6FRI TPF5A US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) SYNCSORT INC. 1993
|
|
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 244 Location: USA
|
|
|
|
| chiru_sh wrote: |
The following information I got about SYNCSORT. Please tell me if I can use SPLICE or JOIN KEYS.
| Code: |
SYNCSORT 3.6FRI TPF5A US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) SYNCSORT INC. 1993
|
|
You are running a version of the product from 15 years ago. SyncSort MVS 3.6 does not support SPLICE or JOIN. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8643 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| The following information I got about SYNCSORT. Please tell me if I can use SPLICE or JOIN KEYS. |
| Quote: |
| You are running a version of the product from 15 years ago. SyncSort MVS 3.6 does not support SPLICE or JOIN. |
Might it be that there are multiple releases of the product on the system and you have "pointed" to an old release that should have been removed?
You could check with your system support people and make sure you are executing from the correct product library. . . |
|
| Back to top |
|
 |
|
|
|