IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - replace value in a file using sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Tue Sep 23, 2008 6:31 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Sep 23, 2008 1:04 pm
Reply with quote

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
View user's profile Send private message
kalpana manoharan84
Currently Banned

New User


Joined: 18 Sep 2008
Posts: 4
Location: Chennai

PostPosted: Tue Sep 23, 2008 3:34 pm
Reply with quote

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
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Tue Sep 23, 2008 8:18 pm
Reply with quote

Arun,
it ia a VB with 100 bytes defined
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Sep 23, 2008 8:47 pm
Reply with quote

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
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Wed Sep 24, 2008 12:26 am
Reply with quote

Yes Arun
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Sep 24, 2008 9:40 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 2
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top