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
 

 

Find and Replace date in hexa decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
sivasree03

New User


Joined: 12 Sep 2008
Posts: 8
Location: chennai

PostPosted: Sat Mar 19, 2011 9:34 am    Post subject: Find and Replace date in hexa decimal
Reply with quote

Hi,

I have to change few dates in hexa decimal format in a sequential file. We will have the dates in different positions. I have to search and replace them.
For example we will have the dates from FEB 01 to FEB 28. We need to change all these dates to MAR 15.

Currently we are using C ALL command for each date and changing all dates to MAR 15. The dates will be from x'1110201c' to x'1110228c'

If anybody of you know logic for this, could you please help me?
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Sat Mar 19, 2011 11:22 am    Post subject:
Reply with quote

What sort of logic? Business logic? Program algorithm?
Why are you changing it to x'1110228c' when you say you want to change it to 15th of March which is x'1110315c'?
Are the dates in fixed places? If so you could write a small COBOL, or other language, program to read in each record, change the date and write the record out again.
If the dates are not in fixed positions you could write an ISPF edit macro to do what you do manually.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2025
Location: Silicon Valley

PostPosted: Sat Mar 19, 2011 10:30 pm    Post subject: Reply to: Find and Replace date in hexa decimal
Reply with quote

Quote:
...will have the dates from FEB 01 to FEB 28


I think the poster meant: "...will have the dates from FEB 01 through FEB 28'
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2025
Location: Silicon Valley

PostPosted: Sat Mar 19, 2011 10:45 pm    Post subject: Reply to: Find and Replace date in hexa decimal
Reply with quote

Here is the logic:
1. create editor macro in rexx, that includes this line:
Code:
"C ALL x'1110201c'  x'1110315c' "

2. repeat the line 27 times
3. use the mouse to copy the sequence numbers (01 through 28) that are shown in the left margin of the editor. Copy a tall but thin area that includes the last two digits of the sequence number and for 28 lines deep.
4. Paste that over the day position in the editor change commands so that each one will now have a different date value (01 through 28).

The point being that sometimes a low tech approach is faster.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Sat Mar 19, 2011 11:23 pm    Post subject:
Reply with quote

Since the "from" value is all possible values of the DAY portion (excluding Feb 29th ) it might be easier to just use the Picture clause of the Editor Change Command - i.e. C P'11102==' C'1110315' ALL
Back to top
View user's profile Send private message
Michael Jakob

New User


Joined: 13 Mar 2011
Posts: 17
Location: Switzerland

PostPosted: Sun Mar 20, 2011 12:16 am    Post subject: Hex-CHange Logic
Reply with quote

Hi, do you expect anything like this?

Edit-Macro
Member CHGDAT
/* REXX */
ADDRESS 'ISPEXEC'
"ISREDIT MACRO (fromDate1 fromDate2 toDate pos)"

ix1 = right(fromDate1,2);
ix2 = right(fromDate2,2);

do ix=ix1 to ix2;
myDate = left(Date1,4)!!right(ix,2);
"isredit" "change x'"myDate"' x'"toDate"' ALL "pos
end;

"ISREDIT" "MEND"
EXIT 0

The call should work like this
COMMAND ==> CHGDAT 110201 28 110315 117
CHGDAT: Edit-Macro
110201: From Date - Feb 01 2011
28: Last From Date for Feb 28 2011
110315: Change to Date
117: Position
Back to top
View user's profile Send private message
sivasree03

New User


Joined: 12 Sep 2008
Posts: 8
Location: chennai

PostPosted: Sun Mar 20, 2011 7:00 pm    Post subject:
Reply with quote

Thanks all for your reply.
Michael,
The FROM date position is not constant, it can be any where in sequential file.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


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