View previous topic :: View next topic
|
Author |
Message |
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
HI,
I have a file which is 100 byte VB. I have a variable defined as S9(04) COMP at byte 20 with value 100. I need to replace the value 100 with 200 which is also a S(04) COMP. Is there a way i can do it with SORT
I use Syncsort.
I thought of OUTREC but i am not sure if i can use outrec with Variable length field.
Thanks
Antony Joseph |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Antony,
Quote: |
I have a variable defined as S9(04) COMP at byte 20 with value 100 |
Are all the records having the value '100' at byte 20? Is the LRECL of input/output file = 100?
Thanks,
Arun |
|
Back to top |
|
|
kalpana manoharan84 Currently Banned New User
Joined: 18 Sep 2008 Posts: 4 Location: Chennai
|
|
|
|
Hi,
Think it can be acheived by using OVERLAY statement. If you have any idea other than using OVERLAY please carry out. Do consider the note for VB datasets for any operations.
The first four bytes of each record contain the Record Descriptor Word or RDW, and the first two bytes of the RDW contain the length of that record (in binary). The first data byte of a VB record is in position 5, after the 4-byte RDW in positions 1-4.
Kindly refer the link which could provide some insight. [use of ALTSEQ/TRAN]
www.ibmmainframes.com/about21405.html |
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Arun,
it ia a VB with 100 bytes defined |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Antony,
Quote: |
Are all the records having the value '100' at byte 20? Is the LRECL of input/output file = 100? |
Do you want to replace the content of numeric field irrespective of the value it has? |
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Yes Arun |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Antony,
The below syncsort job should work for your requirement. Taking 4 byte 'RDW' into consideration, the actual data starts at pos-24. Try this and let know if you find any isses.
Code: |
//STEP00 EXEC PGM=SORT
//SORTIN DD DSN=Input-VB-file
//SORTOUT DD DSN=Output-VB-file
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC OVERLAY=(24:+200,TO=FI,LENGTH=2)
SORT FIELDS=COPY
//* |
|
|
Back to top |
|
|
|