IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Replacing records at different positions


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

Active User


Joined: 22 Mar 2009
Posts: 156
Location: South Africa

PostPosted: Wed Sep 24, 2014 12:11 am
Reply with quote

Hi,
I have a file with RECL=448 and RECFM=VB.
I want to replace position from position 239 length 12 into position 251 length 12.
Basically whatever value from position 251(length=12) has it should move to 239(length=12).
After that 251(length =12) should be repalaced by zeroes. Also these two variables are S9(10)V99.

Example:
Code:
10 AAAAAAA-PROGR-NUM             224 000000002179814           
10 AAAAAAA-PROGRASE-AMT          239 00000000005{             
                                 239 0.50                     
10 AAAAAAA-PROG-BACK             251 00000005090{             
                                 251 509.00                  This must go into field AAAAAAA-PROGRASE-AMT and be changed to zero.   
10 AAAAAAA-PROG-TRAN-CODE        263 525                       
10 AAAAAAA-PROG-PT               267 Y                         
10 AAAAAAA-PROG-CODE             268 09249908 
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2503
Location: NY,USA

PostPosted: Wed Sep 24, 2014 9:37 pm
Reply with quote

Use [URL] BBCode for Links

Please let us know if you get any issues while doing so.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 156
Location: South Africa

PostPosted: Thu Sep 25, 2014 3:50 am
Reply with quote

Thanks Rohit.
The below card worked:
Code:
//SYSIN DD *                               
  OPTION COPY,VLSHRT                       
  INREC OVERLAY=(244:256,12)               
  OUTREC OVERLAY=(256:C'000000000000')     
/*   


I dont know why I was trying BUILD instead OVERLAY due to which I was not getting the desired output.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu Sep 25, 2014 11:58 am
Reply with quote

This is the description of VLSHRT from the manual, so it is doing nothing for you:

Quote:
Temporarily overrides the VLSHRT installation option, which specifies whether
DFSORT is to continue processing if a "short" variable-length SORT/MERGE
control field, INCLUDE/OMIT compare field, or SUM summary field is found.
A short field is one where the variable-length record is too short to contain the
entire field, meaning that the field extends beyond the record. VLSHRT applies
to the SORT, MERGE, INCLUDE, OMIT and SUM statements, and to the
INCLUDE and OMIT parameters of the OUTFIL statement.


You previously used BUILD and encountered problems with short records, and didn't identify what those short records were (so that you could avoid them).

You now use OVERLAY. It won't fail with the short records, but it will extend them to the length of your OVERLAY fields which I strongly doubt it what you really want to do.

You don't need to use INREC and OUTREC anyway, you could code that all on one OVERLAY.

If you'd showed the cards you were trying and the problems you had, you'd have had an answer long ago.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Inserting records into the empty segm... IMS DB/DC 0
No new posts JCL for replacing code in Cobol JCL & VSAM 8
No new posts JCL to extract repeating records DFSORT/ICETOOL 6
No new posts Group selective VB records - Trailer ... DFSORT/ICETOOL 16
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... SYNCSORT 1

Back to Top