View previous topic :: View next topic
|
Author |
Message |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
I have an input file having an LRECL= 12029
and my output LRECL=8.I used an INREC to reformat my input file
Code: |
SORT FIELDS=(7,4,CH,A,26,4,CH,A)
INREC FIELDS=(1:7,4,5:26,4)
SUM FIELDS=NONE
END
|
But i am getting the error
WER027A :
"CONTROL FIELD BEYOND RECORD"
A search with the above error code retrieved the following info.
Explanation: The location of the last byte of a SORT/MERGE control field is
beyond the maximum record length that you specified, or a variable length record is
shorter than the ending location of a specified control field.
Thanks
Arun |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi dick,
Thanks for ur immediate response.I tried using the VLTEST parameter, but i am getting some other error.My requirement is like this.
Input file format
Code: |
01 INPUT-REC.
05 WS-RGDS.
10 WS-GROUP1.
15 WS-ID1 PIC S9(9) COMP-3.
15 CW-ID2 PIC X.
10 WS-GROUP2.
15 WS-SDC PIC 9(04).
15 WS-STYLE PIC 9(09).
05 WS-SEQ PIC 9(02).
05 WS-NBR PIC 9(04).
05 WS-CDC PIC 9(04).
05 WS-STO OCCURS 3000 TIMES
INDEXED BY WS-INX.
10 WS-STO PIC 9(4). |
I need the output file in this format without duplicates:
Code: |
01 OUTPUT-REC.
05 WS-SDC PIC 9(04).
05 WS-CDC PIC 9(04). |
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi
I tried with the same card except for INREC, I gave OUTREC and it worked fine !!..Could anybody plz explain what was wrong with the INREC.
Thanks
Arun |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I don't usually answer Syncsort questions, but this is really more of a general question so I will.
INREC is processed before SORT. OUTREC is procesed after SORT.
Your INREC statement creates an 8-byte record. So you get the error message when your SORT statement uses 26,4 which is beyond the 8-byte record.
But with OUTREC, you SORT on the input record and then create the 8-byte output record so you don't get an error message. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Frank
Thank u so much.
Arun |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi
I have read somewhere that INREC is better than OUTREC while considering performance as we wont be sorting unwanted fields.Is it possible to use INREC in this scenario?..
Correct me if I am wrong
Thanks
Arun |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Arun,
Quote: |
I have read somewhere that INREC is better than OUTREC while considering performance as we wont be sorting unwanted fields.Is it possible to use INREC in this scenario?.. |
It depends. As Frank said - "INREC is processed before SORT. OUTREC is procesed after SORT."
If you are not sorting the file (i.e., when you use sort fields=copy), perfomance of both INREC and OUTREC is similar. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Murali,
Thanks for ur reply. I need a SORT as well as a format change.So it is not possible to use INREC to format the input before the SORT in my requirement..right??
Thanks
Arun |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Arun,
Quote: |
So it is not possible to use INREC to format the input before the SORT in my requirement..right?? |
Not exactly. Assume your IP file is 80 in length and you wanted your OP file to be 85 (say you wanted some data from 81 to 85) and wanted to sort on 1-10 columns. Even in this situation, you could use either INREC/OUTREC.
If you use INREC, SORT sees your IP file 85. Whereas if you use OUTREC sort sees your IP file as 80 in lenght. As Frank mentioned -
Quote: |
INREC is processed before SORT. OUTREC is procesed after SORT. |
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Murali,
Quote: |
So it is not possible to use INREC to format the input before the SORT in my requirement..right?? |
I understood the difference between INREC and OUTREC.What I said was I wont be able to use INREC in my case.If it is possible then could you please post the sort card here..
Thanks
Arun |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, you can use INREC in this case. You just have to sort on the reformatted record like this:
Code: |
INREC FIELDS=(1:7,4,5:26,4)
SORT FIELDS=(1,4,CH,A,5,4,CH,A)
SUM FIELDS=NONE
|
|
|
Back to top |
|
|
annujp
New User
Joined: 31 Aug 2005 Posts: 39 Location: St Paul,MN
|
|
|
|
If your file has a variable block then you can end up with this error. Do let us know if it worked fine with the sortcard Frank mentioned.
Thanks
Anitha |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If the input file was VB, then the RDW would be missing from the INREC statement and I would expect a different error - at least DFSORT would give a different error. (This is why I generally don't answer Syncsort questions - because I have to guess what Syncsort would do as opposed to knowing what DFSORT would do.) |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Frank
Thank u so much.Mine is a FB record.I ll check it and get back to you later as I am out of office this weekend.
Thanks
Arun |
|
Back to top |
|
|
|