Count records in a file using dfsort




















I was able to do this before, but I consolidated the 2 steps I had before into one:. My next job was to get the highest record count in a job to the top. I was able to accomplish this by sorting in descending order for the second sort input, see below.

I also added a new row on position to push the highest record count so that I was able to use it later. In the forth column I now have the total number of rows in a job. At that was left was to revert back to the original order of records. This was done by sorting on the same columns, but using ascending order for the second sort input instead of descending.

When looking back at this solution, I was thinking way to difficult which resulted me in not being able to figure this out :. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 3 months ago. Active 3 months ago. Viewed times. One thing I want to achieve is the following: first line of job output last line of job output total lines of job output per job I managed to get the total lines of the complete output , job number and total lines of the job in my result: 1 2 3 1 Total lines 2 Job number 3 Lines in job To make the example easier to understand and not knowing details of your record layout , I am treating the 3-byte PD field as if it begins in position 1 of fixed-length data.

Feel free to modify the example to fit your actual data layout. Briefly, I'm adding a numeric to each record and sorting them on the numeric field and summing all such records, which will give you the desired output. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to get the records count using Syncsort? Ask Question. Asked 10 years, 1 month ago. Active 6 years, 8 months ago. Viewed 21k times. I could not get the result. Ex: Input File data in 3 bytes which is in Comp-3 Format Sekhar Sekhar 4 4 gold badges 6 6 silver badges 20 20 bronze badges.

Re: Count the number of records from the input file by jvinoth » Tue May 29, am jvinoth wrote: Hi, I need to count the number of records from the input file using sort. Re: Count the number of records from the input file by jvinoth » Tue May 29, pm Select all.

Re: Count the number of records from the input file by dick scherrer » Tue May 29, pm Hello, Is there some reason you did not post the complete error messsage including the message id?



0コメント

  • 1000 / 1000