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: 7315

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 change string before sertan string anatol DFSORT/ICETOOL 8 Tue Aug 15, 2017 5:43 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm


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