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
 
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 VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts Copying only first and last word from... chandan.inst SYNCSORT 4 Wed Jan 31, 2018 4:19 pm
No new posts How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts How to change the logon screen info o... sakthikumarT TSO/ISPF 4 Fri Dec 29, 2017 6:44 pm

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