View previous topic :: View next topic
|
Author |
Message |
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Hi,
Anybody has na idea on how to search for hard coded db2 timestamp in cobol source? Aside from manually going through all the prgrams.
I have 100 cobol programs and I wanted to check if there are hard coded timestamps in the programs.
Thanks! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I'm not sure I understand you, but have you a product with which you can search a PDS/some other source library? If so, is that any use to you? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
it looks to me more an issue of pattern searching
since the timestamp <value> is unpredictable...
noo way with common searching tools , need to be creative |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
It the "timestamp" has been coded to cover the last decade-or-so it would start '20 or "20.
It can sometimes be "tricky" to get the correct number of quotes/apostrophes for such a case, and you may well get false hits (fewer if all the hard-coding is for 2010 onwards) but it will be "obvious" on the output what is a timestamp and what isn't.
If you are doing Greater than or Less than with the timestamp, you may well have a low-order part of the literal you could use to search for with even better results. Or both of them on the same line.
I can be wildly wrong, as I don't really know what you are talking about :-) |
|
Back to top |
|
|
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hello,
Quote: |
I have 100 cobol programs and I wanted to check if there are hard coded timestamps in the programs. |
As suggested by enrico and bill, alteast parital values should be known to you to perform the search.
In your source PDS,
try giving the command
to find the programs used the current year & current month.
Likewise, Modify on your need(might require to know the year,month) & do the search . |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
In a COBOL Load Module, there is a date/time stamp which conforms to what is returned by the WHEN-COMPILED function.
You can visually find this within the first X'100' bytes of a given Load Module, by browsing the targeted loadlib using ISPF 3.4. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
don't forget the copybooks |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
within edit you can use following command to locate timestamps
Code: |
find p'####$##$##$##$##$##' |
You could write a rexx that opens each member in edit, does above find and reports the returncode. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
GuyC wrote: |
within edit you can use following command to locate timestamps
Code: |
find p'####$##$##$##$##$##' |
You could write a rexx that opens each member in edit, does above find and reports the returncode. |
Good one! One of my pet ISPF peeves is that the SRCHFOR command doesn't support picture strings. If it did, then you wouldn't have to write a rexx. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Mabuhay, sprikitik !
I tried using ISRSUPC with the following statements:
Code: |
SRCHFOR '-'
SRCHFORC '-',+3
SRCHFORC '-',+3
SRCHFORC '.',+3
SRCHFORC '.',+3 |
It found the timestamps I scattered in my test pds.
Note: I didn't do extensive tests, there may be some false alerts too. |
|
Back to top |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Marso wrote: |
Mabuhay, sprikitik !
I tried using ISRSUPC with the following statements:
Code: |
SRCHFOR '-'
SRCHFORC '-',+3
SRCHFORC '-',+3
SRCHFORC '.',+3
SRCHFORC '.',+3 |
It found the timestamps I scattered in my test pds.
Note: I didn't do extensive tests, there may be some false alerts too. |
Hey, SalamaT!
It worked! |
|
Back to top |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Thanks for all the replies! I appreciate it very much! |
|
Back to top |
|
|
|