View previous topic :: View next topic
|
Author |
Message |
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
My requirement is that I have input file LRECL 200 FB and the output should contain records where first 37 characters are unique. If there are duplicates then first record out of them should alone be included in output . Also I want to Include ONLY the records that have 'MYREC' in the position 38. Can I use SYNCTOOL to do it in single pass ? I mean can we use USING as well as EQUAL (or NODUPS etc.,) in the same pass ? I tried the following code but it says USING is illegal. Please help me out with this
Code: |
//STEP01 EXEC PGM=SYNCTOOL,REGION=0M
//IN DD DISP=SHR,DSN=Input file
//OUT DD DSN=Output file
//DISCARD DD DSN=Discard.record.file
//TOOLMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,37,CH) USING CTL1 EQUAL(1) DISCARD(DISCARD)
/*
//CTL1CNTL DD *
SORT FIELDS=COPY
INCLUDE COND=(38,5,CH,EQ,C'MYREC ')
//* |
|
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
try this...
Code: |
SELECT FROM(IN) TO(OUT) ON(1,37,CH) USING(CTL1) FIRSTDUP |
|
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Raak -
Thanks for your control card. But this gives only the records which have duplicates in postion 1,37. But My output should also include unique records. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
use
Code: |
SELECT FROM(IN) TO(OUT) ON(1,37,CH) USING(CTL1) FIRST |
|
|
Back to top |
|
|
Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
Thank you Krisperms
Quote: |
use
Code:
SELECT FROM(IN) TO(OUT) ON(1,37,CH) USING(CTL1) FIRST
|
Your confidence(in saying Use instead of the usual 'try') worked perfect for me. |
|
Back to top |
|
|
|