View previous topic :: View next topic
|
Author |
Message |
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
abhay pratap singh,
what is the mininum and maximum length of the field that occur before string "-"?
What is the LRECL and RECFM of your input file?
If you provide the above information it will be easy to provide you the exact solution accoring to the version available in your shop. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
shankar,
Quote: |
column 1 and 77 and not in column 78, 79 and 80. Please correct me if i am wrong.
|
You are correct. We are assuming that "-" will always be followed by 3 bytes on which we should sort.
Let us wait for the OP to respond with the Record length details. |
|
Back to top |
|
|
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
[quote="shankar.v"]abhay pratap singh,
Quote: |
OUTREC=(1,80,2,3),OPTION COPY |
Thanks a lot shankar.Code is working and i have got the expected result.
But i have 2 doubts--
1) Whats the meaning of the outrec statement we are using in first sort.I am not getting the meaning of numbers we are using after 80.
2) Use of "OPTION COPY" in sysin card of first sort. Can we use SORT FIELDS=COPY here. |
|
Back to top |
|
|
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
shankar.v wrote: |
what is the mininum and maximum length of the field that occur before string "-"?
What is the LRECL and RECFM of your input file?
|
Maximum length = 78,Minimum length=2
LRECL=80,RECFM=FB |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
abhay pratap singh,
Quote: |
Whats the meaning of the outrec statement we are using in first sort.I am not getting the meaning of numbers we are using after 80. |
Three bytes after the string "-" is placed in 81st postion.
Quote: |
Use of "OPTION COPY" in sysin card of first sort. Can we use SORT FIELDS=COPY here. |
yes, you can use. OPTION COPY and SORT FIELDS=COPY are same.
Quote: |
abhay pratap singh,
what is the mininum and maximum length of the field that occur before string "-"?
What is the LRECL and RECFM of your input file?
If you provide the above information it will be easy to provide you the exact solution accoring to the version available in your shop. |
????? |
|
Back to top |
|
|
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
shankar.v wrote: |
abhay pratap singh,
what is the mininum and maximum length of the field that occur before string "-"?
What is the LRECL and RECFM of your input file?
|
Maximum length = 78,Minimum length=2
LRECL=80,RECFM=FB |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
Quote: |
Maximum length = 78,Minimum length=2
LRECL=80,RECFM=FB |
.
As sorting is going to happen on three bytes, the maximum length of the field before string "-" should be 76. So that "-" will present in 77th column and we will get the last three bytes(78th byte, 79th byte and 80th byte) of the file for sorting.
In your case as the maximum length of the field before string "-" is 78,
if string "-" is present on 78, we will get last two bytes(79th byte and 80th byte) of the file for sorting, instead of three and
if string "-" is present on 79, we will get last one byte(80th byte) of the file for sorting, instead of three.
What you want to do in the above case? |
|
Back to top |
|
|
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
shankar.v wrote: |
Quote: |
Maximum length = 78,Minimum length=2
LRECL=80,RECFM=FB |
.
In your case as the maximum length of the field before string "-" is 78,
if string "-" is present on 78, we will get last two bytes(79th byte and 80th byte) of the file for sorting, instead of three and
if string "-" is present on 79, we will get last one byte(80th byte) of the file for sorting, instead of three.
What you want to do in the above case? |
Both the cases are fine because if i am having 78 bytes before "-" then only two bytes i will have after "-" and similarly in the second case.So that is not a problem.
Thanks a lot....... |
|
Back to top |
|
|
|