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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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