Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Inserting a string to a VB file using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Inserting a string to a VB file using DFSORT
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 31, 2014 6:25 pm    Post subject:
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    Post subject: Reply to: Inserting a string to a VB file using DFSORT
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 31, 2014 6:50 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Fri Oct 31, 2014 8:08 pm    Post subject: Reply to: Inserting a string to a VB file using DFSORT
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 31, 2014 8:19 pm    Post subject:
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    Post subject: Reply to: Inserting a string to a VB file using DFSORT
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us