View previous topic :: View next topic
|
Author |
Message |
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Anyone know how to omit the last record in SYNCSORT? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Srivastava,
U can use following sort card
Code: |
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTFIL FILES=1,ENDREC=1,OUTREC=(1,80) |
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Ekta,
Quote: |
Anyone know how to omit the last record in SYNCSORT? |
Quote: |
OUTFIL FILES=1,ENDREC=1,OUTREC=(1,80) |
Should not be -
Code: |
OUTFIL FILES=1,STARTREC=2OUTREC=(1,80) |
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Quote: |
OUTFIL FILES=1,STARTREC=2OUTREC=(1,80) |
Sorry forgot to put ',' between STARTREC & OUTREC in my prev post. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Murali,
Yeap u r right ,I have misread the post .yeap it should be
Shrivatsa,
Code: |
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTFIL FILES=1,STARTREC=2,OUTREC=(1,80) |
But it will show the output in reverse order & if u want to see the record in orignal order than let me know i will provide u the sort card |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Murali,
Your control card is working as you told. As you gussed I need in original order. So can you please provide the same.
Thanks |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Shrivatsa,
Just add one more Step after this step.
Code: |
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTFIL FILES=1,OUTREC=(1,80) |
Or otherwise if u know the number of record in ur i/p file then use following sortcard it will solve ur problem in one step
Code: |
OPTION COPY
OUTFIL FILES=1,ENDREC=N |
|
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Here N should be total no of records - 1 |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Ajay,
Quote: |
Here N should be total no of records - 1 |
Are you sure? 'ENDREC=1' copies only ONE record to OP file.
Please note 'N' should be your record count-1. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Ajay,
Since total no of records is highlighted and not '-1' part, I misunderstood the post. Sorry......... |
|
Back to top |
|
|
saptagiri kintali
New User
Joined: 21 Sep 2007 Posts: 20 Location: chennai
|
|
|
|
hi,
u can omit the last record
u can use STOPAFT=(no.of records-1) in your sort card by using " sort" ,it willl help u when u know no.of records only..otherwise find no.of records as shown by others |
|
Back to top |
|
|
|