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

How to change a record to '20100101' when its first two byte


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

New User


Joined: 24 Nov 2009
Posts: 37
Location: Don't know

PostPosted: Wed Jan 13, 2010 10:10 am
Reply with quote

How to change a record to '20100101' when its first two bytes are '00' using sort?

This a date change requirement the starting position is 47.

If the first two bytes of 47th column of a record is '00' then we need to replace the 8 bytes data from 47th column of the same record to '2010101'
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 13, 2010 10:21 am
Reply with quote

Quote:
we need to replace the 8 bytes data from 47th column of the same record to '2010101'

2010101 only 7 bytes icon_question.gif is it correct?

What sort product are you using?
Back to top
View user's profile Send private message
santoshkumarmanilakkoju

New User


Joined: 24 Nov 2009
Posts: 37
Location: Don't know

PostPosted: Wed Jan 13, 2010 10:23 am
Reply with quote

its actually '20100101'. We use SYNCSORT
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jan 13, 2010 10:33 am
Reply with quote

Hi,

try
Code:
   SORT FIELDS=COPY                                                 
   INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101'))



Gerry
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 13, 2010 10:35 am
Reply with quote

Below SORTCARD will give you desired result.

Code:

//SYSIN DD *                                                       
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101')) 
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 13, 2010 10:39 am
Reply with quote

Opps.. Sorry Gerry.. I couldn't see your post. Anywasy this should be moved to JCL forum
Back to top
View user's profile Send private message
santoshkumarmanilakkoju

New User


Joined: 24 Nov 2009
Posts: 37
Location: Don't know

PostPosted: Wed Jan 13, 2010 11:52 am
Reply with quote

Hi Sambhaji/Gerry

The code worked but I need the same change to be done for another date field atrting at 55th position.

Below is what I tried but the second field is not changing, the sort is copying the same input to ouput.
Ex: 0010010100100101 is changed to 2010010100100101

//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101')),
IFTHEN=(WHEN=(55,2,CH,EQ,C'00'),OVERLAY=(55:C'20100101'))
/*
[/list][/code]
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 13, 2010 12:04 pm
Reply with quote

Use below one.
Code:

//SYSIN DD *
  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101'),HIT=NEXT),
  IFTHEN=(WHEN=(55,2,CH,EQ,C'00'),OVERLAY=(55:C'20100101'))
/*
Back to top
View user's profile Send private message
santoshkumarmanilakkoju

New User


Joined: 24 Nov 2009
Posts: 37
Location: Don't know

PostPosted: Wed Jan 13, 2010 12:08 pm
Reply with quote

Yes I tried this,

//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),
OVERLAY=(47:C'20100101'),HIT=NEXT),
IFTHEN=(WHEN=(55,2,CH,EQ,C'00'),OVERLAY=(55:C'20100101'))
/*

and it worked.Thankyou
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 13, 2010 12:13 pm
Reply with quote

You are welcome.. icon_smile.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top