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

SYNCSORT - Control field beyond record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jul 02, 2007 9:19 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 02, 2007 9:27 pm
Reply with quote

Hello,

Please look at the last part of page 2 of this topic. It may have the info you need.

http://ibmmainframes.com/viewtopic.php?t=18206&start=15

Just let us know if there are questions after you read this.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jul 02, 2007 10:20 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 03, 2007 12:12 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 03, 2007 12:44 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 03, 2007 1:19 pm
Reply with quote

Hi Frank

Thank u so much.

Arun
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 03, 2007 1:25 pm
Reply with quote

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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jul 03, 2007 1:46 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 03, 2007 5:41 pm
Reply with quote

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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jul 03, 2007 5:48 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 03, 2007 6:51 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 03, 2007 8:28 pm
Reply with quote

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

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Wed Jul 04, 2007 12:48 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jul 04, 2007 12:57 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 05, 2007 8:00 pm
Reply with quote

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
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

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top