View previous topic :: View next topic
|
Author |
Message |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
Back to top |
|
|
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|