View previous topic :: View next topic
|
Author |
Message |
suyash_agrawal
New User
Joined: 27 Nov 2006 Posts: 7 Location: India
|
|
|
|
Hello everyone,
I need your help to achieve the following:
1. Remove duplicates from file based on fragmented key
Input: FB, LRECL-80
Key fields: 4,3,CH & 10,2,CH (Composite)
AAAA111BB22
AAAA222BB34
BBBB111CC22
ABCD222BB33
Output:
AAAA111BB22
AAAA222BB34
ABCD222BB33
Requirement demands that output file should not be sorted.
2. Format file based on field values
Input: FB, LRECL 80
AAAAAAA (6 spaces in front)
BBBBBBBBB (3 spaces in front)
AAAAABB
BBBBDDDDD
Records starting at position 7 will always start with 'A' and those starting at position 4 will always start with 'B'.
Output: (2 spaces in front)
AAAAAAA
BBBBBBBBB
AAAAABB
BBBBDDDDD
Again if this can be done without sorting it'd be great.
Many Thanks,
Suyash |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Suyash,
For ur first query
Quote: |
1. Remove duplicates from file based on fragmented key |
In first step
Code: |
//SYSIN DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(4,3,CH,A,10,2,CH,A)
SUM FIELDS=NONE
/* |
In second step
Code: |
//SYSIN DD *
SORT FIELDS=(81,8,ZD,A)
OUTREC FIELDS=(1:1,80)
/* |
Hope it will helpful |
|
Back to top |
|
|
suyash_agrawal
New User
Joined: 27 Nov 2006 Posts: 7 Location: India
|
|
|
|
Thanks Ekta.
1. The problem i'm facing is that output file should not be sorted and should be in the same order as input with duplicates omitted.
2. The query hasn't come out as intended. Apologies for that. I'll try again:
Format file based on field values
Input: FB, LRECL 80 ('*' - space)
******AAAAAAA
***BBBBBBBBB
******AAAAABB
***BBBBDDDDD
Records starting at position 7 will always start with 'A' and those starting at position 4 will always start with 'B'.
Output:
**AAAAAAA
**BBBBBBBBB
**AAAAABB
**BBBBDDDDD
Again if this can be done without sorting it'd be great.
Cheers! |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Suyash,
It should work as i specified in my prev post to resolve ur first issue we have to use two step in sort first step will remove the duplicate & sort them on concatenated key but we put a counter at 81 byte & in the second step it will put it in the original order according to that counter. |
|
Back to top |
|
|
suyash_agrawal
New User
Joined: 27 Nov 2006 Posts: 7 Location: India
|
|
|
|
Thanks a lot Ekta.
First issue is sorted now. I misunderstood your previous response.
Regards,
Suyash |
|
Back to top |
|
|
subhasis_50
Moderator
Joined: 09 Mar 2005 Posts: 363 Location: Earth
|
|
Back to top |
|
|
suyash_agrawal
New User
Joined: 27 Nov 2006 Posts: 7 Location: India
|
|
|
|
Thanks Subhasis.
I tried it but received following error:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5
OPTION COPY
INREC BUILD=(1,2000,JFY=(SHIFT=LEFT,LEAD=C' '))
?
ICE006A 0 OPERAND DEFINER ERROR
Does it mean that the latest patch might not have been updated in my system?
I've used following JCL:
//CPSD0025 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input file
//SORTOUT DD DSN=output file
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,2000,JFY=(SHIFT=LEFT,LEAD=C' '))
/*
//*
Regards,
Suyash |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
suyash,
subhasis has the right idea but the actual DFSORT job would be as follows:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAAAAAA
BBBBBBBBB
AAAAABB
BBBBDDDDD
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(2X,3,78,JFY=(SHIFT=LEFT))
/*
|
The error message indicates you don't have z/OS DFSORT V1R5 PTF UK90007 (April, 2006) installed. You need that PTF to use JFY. Ask your System Programmer to install that PTF (it's free). |
|
Back to top |
|
|
suyash_agrawal
New User
Joined: 27 Nov 2006 Posts: 7 Location: India
|
|
|
|
Thank you Frank. I'll try to get it installed.
Regards,
Suyash |
|
Back to top |
|
|
|