And both my input file and output file are VB and has the record length of 30. When I run the job I get the error
Code:
WER235A SORTOUT OUTREC RDW NOT INCLUDED
When I run the same code with FB file it works fine. I searched the error and found Positions 1-4 are reserved for the RDW, so you need to write from pos 5 not pos 1.
I tried to write from Pos 5 in BUILD condition and still get the same error
Your include condition start from 1, Begin= from 1 and you already know you have a VB and you already know about RDW. Did you do any search/reading before posting?
Post the Sort card you are using on the VB files if it is different than what you have posted.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
If you have a VB you have to offset all your data-locations by four. So your 1,1 in the INCLUDE, for instance, should be 5,1.
When you BUILD your output record, you must always include the existing RDW, which SyncSORT will then maintain for you. So your BUILD should start with 1,4, and then remember the offset for the data positions.
Since it is a variable record file and you are trying to do a substring search (SS), you need to make sure that the records are filled with data till the position you are searching.
e.g. record 1 can have an lrecl of 30 but record 2 can have lrecl of 25. If you do a 5,30,SS then it will give you an error as record 2 doesn't have anything in bytes 26-30.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You'd best show us the JCL.
There is confusion in what you are doing. You use a data-length of 34 for your INCLUDE COND but overwrite the last four bytes with the PUSH. All your output records have 30 bytes of data, so why is it a variable-length record.
You'd better show some sample data and expected output. Everything in the Code tags to preserve spacing, don't bother trying to highlight things. If they are there and coded, we'll spot them.