Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us