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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to change a record to '20100101' when its first two byte
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    Post subject:
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    Post subject: its actually '20100101'. We use SYNCSORT
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: 1703
Location: Australia

PostPosted: Wed Jan 13, 2010 10:33 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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