Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - replace value in a file using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - replace value in a file using sort
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: 2180
Location: @my desk

PostPosted: Tue Sep 23, 2008 1:04 pm    Post subject:
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    Post subject: Reply to: Syncsort - replace value in a file using sort
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]
http://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    Post subject: Reply to: Syncsort - replace value in a file using sort
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: 2180
Location: @my desk

PostPosted: Tue Sep 23, 2008 8:47 pm    Post subject:
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    Post subject: Reply to: Syncsort - replace value in a file using sort
Reply with quote

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

Moderator


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

PostPosted: Wed Sep 24, 2008 9:40 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us