Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2353
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: 2353
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: 2353
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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us