View previous topic :: View next topic
|
Author |
Message |
relur197
New User
Joined: 31 Jul 2008 Posts: 18 Location: Massachusetts
|
|
|
|
Hi Folks,
I have this jcl:
Code: |
//STEP9 EXEC DISKSORT
//SORTMSG DD SYSOUT=R
//SORTIN DD DSN=FILE A,DISP=SHR
// DD DSN=FILE B,DISP=SHR
//SORTOUT DD SYSOUT=R
//SORTXSUM DD DSN=FILE C,DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,8,CH,A)
SUM FIELDS=NONE,XSUM
/*
// |
This is working as intented and is doing what it needs to be done it is taking and comparing the first 8 characters of both datasets by character in ascending order, if there are any duplicates found. Export them to a certain dsn. Now imagine if there was data on FILE B that was needed and FILE A is just used for the first 8 characters on each record.
Right now I am getting "most" of the data I need but some records are outputting to FILE C with just the first 8 characters.
Any suggestions? |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Which SORT utility are you running? |
|
Back to top |
|
|
relur197
New User
Joined: 31 Jul 2008 Posts: 18 Location: Massachusetts
|
|
|
|
SyncSort |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
You can probably use the JOIN feature, but before I can provide you with the control statements, I need a little more information. For starters, the RECFM and LRECL would be helpful. Also, can you provide some sample data for your 2 input files and what you want included in your output? For example, do you only want records from File A in the output? |
|
Back to top |
|
|
relur197
New User
Joined: 31 Jul 2008 Posts: 18 Location: Massachusetts
|
|
|
|
This is the output from my current sort.
The LRECL of each is 80.
The RECFM is Fixed Block.
This is "FILE C"
Code: |
ACVRUAL4 0.29
ACVRUAL7 1.09
ACVRUBKP 26.73
ACVRULC1
ACVRULC2 0.69
ACVRULC3
ACVRULC4 0.35
ACVRULC5
ACVRULC7 2.1
ACVRULC8
ACVRURPA 0.35
ACVRURPB
ACVRURP1 0.15
ACVRURP2
ACVRURP3 0.37
ACVRURP4
ACVRUVNA 0.38
ACVRUVNB
ACVRUVNC 0.65
ACVRUVND
ACVRUVNE 0.56
ACVRUVNF
ACVRUVNG 0.35
ACVRUVNZ
ACVRUVN1 1.18
ACVRUVN2
|
This is "FILE A"
Code: |
ACVRUAL1
ACVRUAL2
ACVRUAL4
ACVRUAL6
ACVRUAL7
ACVRUAL8
ACVRUBKP
ACVRULC1
ACVRULC2
ACVRULC3
ACVRULC4
ACVRULC5
ACVRULC6
ACVRULC7
ACVRULC8
ACVRURPA
ACVRURPB
ACVRURP1
ACVRURP2
ACVRURP3
ACVRURP4
ACVRUVNA
ACVRUVNB
ACVRUVNC
ACVRUVND
ACVRUVNE
|
This is "FILE B"
Code: |
ACF40 5.41
ACVRUAL4 0.29
ACVRUAL7 1.09
ACVRUBKP 26.73
ACVRULC1 1.1
ACVRULC2 0.69
ACVRULC3 0.89
ACVRULC4 0.35
ACVRULC5 0.02
ACVRULC7 2.1
ACVRULC8 0.19
ACVRURPA 0.35
ACVRURPB 0.34
ACVRURP1 0.15
ACVRURP2 0.2
ACVRURP3 0.37
ACVRURP4 0.32
ACVRUVNA 0.38
ACVRUVNB 0.37
ACVRUVNC 0.65
ACVRUVND 0.37
ACVRUVNE 0.56
ACVRUVNF 0.37
ACVRUVNG 0.35
ACVRUVNZ 0.03
ACVRUVN1 1.18
|
Right now, what you can see happening in FILE C is that when it is performing the check for the duplicate it is getting "one than the other" with the decimal number.
Yes, what I cant figure out is to have only the records from this case "FILE B" to be included in "FILE C". Maybe taking the route of checking for duplicate as matching was a bad idea... |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
relur197,
If you have Syncsort for z/OS 1.2 or above, you can easily do this using the JOIN feature as Alissa pointed out. Which version are you using? You can find this info on the top of the SYSOUT. |
|
Back to top |
|
|
relur197
New User
Joined: 31 Jul 2008 Posts: 18 Location: Massachusetts
|
|
|
|
SYNCSORT FOR Z/OS 1.3.0.2R |
|
Back to top |
|
|
relur197
New User
Joined: 31 Jul 2008 Posts: 18 Location: Massachusetts
|
|
|
|
Darnit, I can't edit my post. Anyway, I am looking into the join control statement now. I will return with anything I have found. Thanks |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Try this JCL instead:
Code: |
//STEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=FILE.A,DISP=SHR
//SORTJNF2 DD DSN=FILE.B,DISP=SHR
//SORTOUT DD DSN=FILE.C,...
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
REFORMAT FIELDS=(F2:1,80)
SORT FIELDS=COPY
/*
|
|
|
Back to top |
|
|
relur197
New User
Joined: 31 Jul 2008 Posts: 18 Location: Massachusetts
|
|
|
|
I can't thank you enough alissa.
Enjoy the holiday arcvns and alissa. |
|
Back to top |
|
|
|