|
View previous topic :: View next topic
|
| Author |
Message |
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Hi,
I am using following code for sorting
| Code: |
//SYSIN DD *
INCLUDE COND=(1,1,CH,EQ,C'P',OR,
1,30,SS,EQ,X'00')
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,1,CH,EQ,C'P'),
PUSH=(31:1,30))
OUTFIL INCLUDE=(1,30,SS,EQ,X'00'),
BUILD=(31,04,/,1,30)
OPTION COPY
/* |
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
Please help. |
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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.
. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| He is using the same card for VB as per his narration and certainly no research done as I could see many such examples already discussed. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
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. |
|
| Back to top |
|
 |
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Hi I tried the below one and still getting the same error
Whichever is highlighted in red below I have added 4 to previous value
INCLUDE COND=(5,1,CH,EQ,C'P',OR,
5,34,SS,EQ,X'00')
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(5,1,CH,EQ,C'P'),
PUSH=(35:5,30))
OUTFIL INCLUDE=(5,30,SS,EQ,X'00'),
BUILD=(35,30,/,5,30)
OPTION COPY
But in the Build, I am not sure where should I include the 1,4.
This is my complete JCL
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXXX,DISP=SHR
//SORTOUT DD DSN=YYYYY,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(10,10),RLSE),
// DCB=(RECFM=VB,LRECL=30,BLKSIZE=0)
//SYSIN DD *
INCLUDE COND=(5,1,CH,EQ,C'P',OR,
5,34,SS,EQ,X'00')
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(5,1,CH,EQ,C'P'),
PUSH=(35:5,30))
OUTFIL INCLUDE=(5,30,SS,EQ,X'00'),
BUILD=(35,30,/,5,30)
OPTION COPY
/* |
|
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
| Back to top |
|
 |
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
Hi,
I modified the code as below
| Code: |
//SYSIN DD *
INCLUDE COND=(5,1,CH,EQ,C'P',OR,
5,34,SS,EQ,X'00')
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(5,1,CH,EQ,C'P'),
PUSH=(35:5,30))
OUTFIL INCLUDE=(5,30,SS,EQ,X'00'),
BUILD=(1,4,35,30,/,1,4,5,30)
OPTION COPY |
And I get error 'SORTOUT HAS INCOMPATIBLE LRECL'
And when I try to adjust that by reducing number of bytes that written in BUILD
I get the error 'INCLUDE/OMIT FIELD BEYOND RECORD'.
I also tried by adjusting in INCLUDE Condition to read from 5 to 30 position and still get the same error.
Code'd |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| dont give lrecl in dcb and let sort determine for you if you have some confusion. |
|
| Back to top |
|
 |
krsenthil85
New User
Joined: 31 Aug 2007 Posts: 55 Location: bangalore
|
|
|
|
| Still it throws same error after removing LRECL from DCB |
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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.
Hope that helps.
. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
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. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|