View previous topic :: View next topic
|
Author |
Message |
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
Hi,
I have a input file whose rec length is 200.
There are 4 fields and the 4th field has rec length of 100 .
I want to sort the file based on the 4th field and for those records for that 4th field whose length exceeds 40.
Thanks in advance
Max |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
You need to try first yourself.
Second , without the sample input and expected output you are less likely get the right answers |
|
Back to top |
|
|
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
I have used this sort card.. getting the output but looks like there are few records which also coming with no values may be low values or hex..
SORT FIELDS=COPY
INCLUDE COND=(141,60,CH,EQ,C' ') |
|
Back to top |
|
|
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
Little correction on my sort card:
SORT FIELDS=COPY
OMIT COND=(141,60,CH,EQ,C' ') |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Quote: |
getting the output but looks like there are few records which also coming with no values may be low values or hex.. |
You need to find those records and find out what values you get and ALTSEQ would help You further to turn them into spaces <if required>.
Please also make a use of "code" tags when representing a code. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2024 Location: USA
|
|
|
|
maxsubrat wrote: |
I have a input file whose rec length is 200.
There are 4 fields and the 4th field has rec length of 100 .
I want to sort the file based on the 4th field and for those records for that 4th field whose length exceeds 40. |
How the "length" of the "4th field" is defined/determined?
1) until first space/comma/quote/zero/whatever else?
2) using the physical end of RECFM=VB?
3) another sophisticated method? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Show us sample input data and the sample output data required. Someone would be able to help. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
According to you, your LRECL is 200. Your record layout description infers that the first 3 fields have a total length of 100 bytes and the fourth field is 100 bytes in length. Where does this length of 40 come in? ALL records will have a length of 100 for the 4th field. |
|
Back to top |
|
|
|