View previous topic :: View next topic
|
Author |
Message |
Devrana88
New User
Joined: 20 Sep 2023 Posts: 7 Location: India
|
|
|
|
Hello Team,
I have two KSDS file with keys on the first 5 bytes but when I tried to merge two files into third VSAM KSDS file(first 5 bytes as key) then I am getting error. Please assist.
Please find below more details.
XXXX.VSAM.KSDSFILE.TEST --- first file
12345Devesh
12346Devesh
12347Devesh
12348Devesh
XXXX.VSAM.KSDSFILE.TEST1 --- second file
12340Devesh
12347Devesh
12348Devesh
12349Devesh
ouput file - XXXX.VSAM.KSDSFILE.TEST2 ---- KSDS file
Tried -
//STEP001 EXEC PGM=ICETOOL ----- didn't work
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN1 DD DSN=XXXX.VSAM.KSDSFILE.TEST,DISP=SHR
//IN2 DD DSN=XXXX.VSAM.KSDSFILE.TEST1,DISP=SHR
//OUT DD DSN=XXXX.VSAM.KSDSFILE.TEST2,DISP=OLD
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) VSAMTYPE(V)
COPY FROM(IN2) TO(OUT) VSAMTYPE(V)
/*
//STEP0001 EXEC PGM=SORT ---- didn't work
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=XXXX.VSAM.KSDSFILE.TEST,DISP=SHR
//SORTIN02 DD DSN=XXXX.VSAM.KSDSFILE.TEST1,DISP=SHR
//SORTOUT DD DSN=XXXX.VSAM.KSDSFILE.TEST2,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,5,CH,A)
/* |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You don't really want help, do you, since you did not tell us what error you got. Hard for us to do much without knowing that.
However, I'm guessing you got duplicate keys messages since the sample data you gave has records with the same key in both files. |
|
Back to top |
|
|
Devrana88
New User
Joined: 20 Sep 2023 Posts: 7 Location: India
|
|
|
|
Apologies for that!
Actually I was expecting unique records in the output KSDS file.
Below errors I was getting:
1- SORT -
WER168I CONTROL FIELD WITHIN RDW
WER410B 9,800K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE
WER410B 0 BYTES RESERVE REQUESTED, 284,160 BYTES USED
WER255A VSAM LOGICAL ERROR 0C ON OUTPUT
WER578I SORTL INSTRUCTION NOT USED; REASON CODE=F6
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
2- ICETOOL -
WER164B 10,828K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,241K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I IN1 : RECFM=V ; LRECL= 80; CISIZE = 4096
WER073I IN1 : DSNAME=SNRT.VSAM.KSDSFILE.TEST
WER110I OUT : RECFM=V ; LRECL= 80; CISIZE = 4096
WER074I OUT : DSNAME=SNRT.VSAM.KSDSFILE.TEST2
WER410B 9,800K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE,
WER410B 0 BYTES RESERVE REQUESTED, 252K BYTES USED
WER255A VSAM LOGICAL ERROR 08 ON OUTPUT
WER578I SORTL INSTRUCTION NOT USED; REASON CODE=F6
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Please let me know if you need any more details from my end. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2131 Location: USA
|
|
|
|
Devrana88 wrote: |
Hello Team,
I have two KSDS file with keys on the first 5 bytes but when I tried to merge two files into third VSAM KSDS file(first 5 bytes as key) then I am getting error. Please assist.
Please find below more details.
XXXX.VSAM.KSDSFILE.TEST --- first file
Code: |
12345Devesh
12346Devesh
12347Devesh
12348Devesh |
XXXX.VSAM.KSDSFILE.TEST1 --- second file
Code: |
12340Devesh
12347Devesh
12348Devesh
12349Devesh
|
ouput file - XXXX.VSAM.KSDSFILE.TEST2 ---- KSDS file
Tried -
Code: |
//STEP001 EXEC PGM=ICETOOL ----- didn't work
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN1 DD DSN=XXXX.VSAM.KSDSFILE.TEST,DISP=SHR
//IN2 DD DSN=XXXX.VSAM.KSDSFILE.TEST1,DISP=SHR
//OUT DD DSN=XXXX.VSAM.KSDSFILE.TEST2,DISP=OLD
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) VSAMTYPE(V)
COPY FROM(IN2) TO(OUT) VSAMTYPE(V)
/*
|
Code: |
//STEP0001 EXEC PGM=SORT ---- didn't work
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=XXXX.VSAM.KSDSFILE.TEST,DISP=SHR
//SORTIN02 DD DSN=XXXX.VSAM.KSDSFILE.TEST1,DISP=SHR
//SORTOUT DD DSN=XXXX.VSAM.KSDSFILE.TEST2,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,5,CH,A) |
/* |
1. Please learn how to use the Code button when posting your code and/or data
2. Your question is not related neither to JCL, nor to VSAM. This is DFSORT/SYNCSORT/ICETOOL/SYNCTOOL question.
3. You cannot get rid of duplicates when using just COPY or MERGE statements. RTFM, please
4. Try to search from Google: "SORT eliminate duplicates" |
|
Back to top |
|
|
Devrana88
New User
Joined: 20 Sep 2023 Posts: 7 Location: India
|
|
|
|
Hello sergeyken,
Is there any way that we can merge two VSAM KSDS file into the third VSAM KSDS file without duplicates through JCL ?
Thanks in advance! |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2131 Location: USA
|
|
|
|
Devrana88 wrote: |
Hello sergeyken,
Is there any way that we can merge two VSAM KSDS file into the third VSAM KSDS file without duplicates through JCL ?
Thanks in advance! |
I repeat once again:
You cannot do anything like this in JCL!!!!!!!!!!
This can be done (and you really started doing this) via any SORT product.
It is highly recommended to start from reading any SORT manual, before coding and/or posting your questions to a Forum.
This is a Help forum, not Do-My-Job-For-Me forum
Note:
Any software developer's job is NOT copying messy letters and characters from others, but the ability TO THINK WITH YOUR OWN MIND. |
|
Back to top |
|
|
Devrana88
New User
Joined: 20 Sep 2023 Posts: 7 Location: India
|
|
|
|
Got you, Thanks! |
|
Back to top |
|
|
|