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

Inserting a string to a VB file using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Oct 31, 2014 6:22 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Oct 31, 2014 6:25 pm
Reply with quote

It's a variable length record, so you need to specify the RDW in the OUTREC statement
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Oct 31, 2014 6:33 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Oct 31, 2014 6:50 pm
Reply with quote

Try
Code:

//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1:1,4,5:5,26,31:C'ABC',34:31)
/*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 31, 2014 8:08 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Oct 31, 2014 8:19 pm
Reply with quote

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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Nov 03, 2014 3:03 pm
Reply with quote

Hi expat and Bill,

both the control cards are working well. Thank you very much.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top