|
View previous topic :: View next topic
|
| Author |
Message |
Ankita Maheshwari
New User
Joined: 12 May 2010 Posts: 23 Location: Pune
|
|
|
|
Hi All,
Currently i am using this sort card to get the count of a file in trailer:
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(1,31,COUNT=(M11,LENGTH=9))
The output i am getting throught this is:
TRAILER 01-DEC-11 06-JAN-10000000450
There are two problems:
1) I want to get a space between the seond date which is 06-JAN-10 and the count 000000450.
2) When in the sort card i use COUNT=(M11,LENGTH=9), it is giving me +1 of the record count, for example: if the record count is 499, it gives 450. And if i use COUNT-1=(M11,LENGTH=9), it is giving me -1 of the record count, for example: if the record count is 499 it gives me 498.
Please Help.
Thanks
Ankita |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Ankita wrote: |
| 1) I want to get a space between the seond date which is 06-JAN-10 and the count 000000450. |
Below will add 1 space between two fields date and count.
| Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(1,31,X,COUNT=(M11,LENGTH=9))
|
| Quote: |
2) When in the sort card i use COUNT=(M11,LENGTH=9), it is giving me +1 of the record count, for example: if the record count is 499, it gives 450. And if i use COUNT-1=(M11,LENGTH=9), it is giving me -1 of the record count, for example: if the record count is 499 it gives me 498.
|
This I don't believe....Remember count will give count of all records including last record(here record with date etc in your case).... |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
2) When in the sort card i use COUNT=(M11,LENGTH=9), it is giving me +1 of the record count, for example: if the record count is 499, it gives 450. And if i use COUNT-1=(M11,LENGTH=9), it is giving me -1 of the record count, for example: if the record count is 499 it gives me 498.
|
Huh? COUNT will give you the count of the data records. The generated trailer record is NOT included in the count. If you have 499 input records, COUNT will give you 499 and COUNT-1 will give you 498.
If you need more help with this, show the //SYSOUT messages you received, and explain what it is you actually want for the count (number of data records, number of data records + 1, or what?). |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|