|
View previous topic :: View next topic
|
| Author |
Message |
ext1fma
New User
Joined: 23 Jun 2006 Posts: 2
|
|
|
|
Hi every one,
I have two input files I need to merge them using SYNCSORT, however I do need to files that is SORTIN01 DD and SORTIN02 DD, The fields that I need to merge the two file are in different position and also XSUM is needed.
I appreciate your help
Thanks |
|
| Back to top |
|
 |
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Hi,
Please put your query in detail.To get the correct and quick solution,proivde the following.
1)Lrecl,format
2)Input files dummy data
3)Expected o/p data
Thank you
Krishy |
|
| Back to top |
|
 |
ext1fma
New User
Joined: 23 Jun 2006 Posts: 2
|
|
|
|
Just 2 data files we need to sort and merge them in one file, based on a number which in the first file is in position 5, length of 5 and the second the number is in position 25 length 5
Thank you krishy |
|
| Back to top |
|
 |
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
ext1fma,
You haven't provided enough info.I just coded the below SORT step that I understood from your reply.
Here the code.Please check and let me know if you need any modification.
Here I am sorting the first file from 2 position to 5 (of length 3) and
second file from position 6 to 8 (of length 3).You can change the code as per your requirement.
| Code: |
//PS020 EXEC PGM=SYNCTOOL
//SYSOUT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
12345
21245
54654
//TEMP1 DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,2),RLSE)
//IN2 DD *
12345678
12345123
12345643
//TEMP2 DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,2),RLSE)
//CON DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=SHR
// DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=SHR
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN1) TO(TEMP1) USING(CTL1)
SORT FROM(IN2) TO(TEMP2) USING(CTL2)
SORT FROM(CON) TO(OUT) USING(CTL3)
//CTL1CNTL DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,5,3X,2,3)
//CTL2CNTL DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,8,6,3)
//CTL3CNTL DD *
SORT FIELDS=(9,3,CH,A)
OUTREC FIELDS=(1,8)
/*
|
The o/p will be
| Code: |
12345123
21245
12345
54654
12345643
12345678
|
Thank you
Krishy |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|