View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
I have a VB file of length 104
I would like to keep first 26 characters as it is and then to insert a string 'ABC' at the position and 27
My JCL
Code: |
//SORTIN DD DSN=MKK157.INFILE,DISP=SHR
//SORTOUT DD DSN=MKK157.OUTFILE,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=105,BLKSIZE=0,RECFM=VB)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5:5,26,31:C'ABC',34:31,74)
/* |
Here is the Error Message
Code: |
ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R1 - 08:25 O
SORT FIELDS=COPY
OUTREC FIELDS=(5:5,26,31:C'ABC',34:31,74)
ICE251A 0 MISSING RDW OR DATA FOR *OUTREC : REASON CODE 02, IFTHEN 0
|
Pls suggest me, How to rectify this error? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It's a variable length record, so you need to specify the RDW in the OUTREC statement |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi expat,
I have also tried
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,5:5,26,31:C'ABC',34:31,74)
/*
|
But error stays the same.
Code'd |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Try
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,5:5,26,31:C'ABC',34:31)
/* |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Just tidying expat's suggestion. Also see here.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1,4,5,26,C'ABC',31) |
Including the columns just make it confusing when they are unnecessary (data field follows data field) and they are only useful on a BUILD when you want to leave a "gap".
No need to use OUTREC unless you need to...
I don't see how you got the same error when your specified 1:1,4, so perhaps you can paste the sysout for that, please? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It probably wasn't the same error.
The second failure I would guess at being because the length of data from column 31 was included and with this being a VB file then not every record would have the required length of data.
As the OP has now gone quiet ............................ |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi expat and Bill,
both the control cards are working well. Thank you very much. |
|
Back to top |
|
|
|