IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How i can sort on a field whose position is not fixed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Nov 30, 2007 11:56 am
Reply with 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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Nov 30, 2007 12:14 pm
Reply with quote

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
View user's profile Send private message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Fri Nov 30, 2007 1:06 pm
Reply with quote

[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
View user's profile Send private message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Fri Nov 30, 2007 1:14 pm
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Nov 30, 2007 1:14 pm
Reply with quote

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
View user's profile Send private message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Fri Nov 30, 2007 1:17 pm
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Nov 30, 2007 1:33 pm
Reply with quote

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
View user's profile Send private message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Fri Nov 30, 2007 3:00 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top