muthukumar
New User
Joined: 24 Mar 2004 Posts: 32
|
|
|
|
Hi all,
i faced the following situation, Please provide solution for this.
I have 3 records with two fields.. name and description.
all the three records has same name where name is the key.but description part is different.
eg
tendulkar
tendulkar He is Brilliant
tendulkar
Out of the three records my sort statement must pick only one and the only one should be that with description.
In case if all the three records didnt have any description than any one of the record can be put in the output...
kindly address this as soon as possible
( please provide solution just with sort.. without using icetool etc...)
regards
Muthu |
|
sandip_datta
EXPERT
Joined: 02 Dec 2003 Posts: 152 Location: Tokyo, Japan
|
|
|
|
I don't know why you don't want to use ICETOOL. If you have DFSORT you must have ICETOOL in your shop.
You don't give us sufficient information. I am assuming the name is of length of 10 and description is of 20 and total length is 80. For simplicity I have used 2 steps.
| Code: |
//STEP01 EXEC PGM=SORT
//SORTWK01 DD SPACE=(CYL,(10,5)),UNIT=DISK
//SORTWK02 DD SPACE=(CYL,(10,5)),UNIT=DISK
//SYSOUT DD SYSOUT=*
//SORTIN DD *
TENDULKAR
TENDULKAR HE IS BRILLIANT
TENDULKAR
/*
//SORTOUT DD DSN=&&TEMP,
// UNIT=DISK,
// DISP=(NEW,PASS,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=(11,20,CH,D)
/*
//STEP02 EXEC PGM=SORT
//SORTWK01 DD SPACE=(CYL,(10,5)),UNIT=DISK
//SORTWK02 DD SPACE=(CYL,(10,5)),UNIT=DISK
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&TEMP,DISP=(OLD,DELETE)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,10,CH,A)
SUM FIELDS=NONE
/*
|
Regards,
Sandip. |
|