×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I know this may not be pure RPG, but I have an "interesting" set of
circumstances that need some light shed on.
We created a file with DDS. In this file, we put a timestamp field as
the last field, type Z. This was so PHP could make use of the date in
a format it recognized rather than a 6 digit number. The file is a
dashboard file with one record per day and we want to use some google
tools to display as graphs, charts, etc.
After creating the file and getting some PHP programs to use the data,
we found we needed to add new fields. Rather than add them on the end,
I put them in the front of the timestamp field, so that timestamp was
the last field in the file? Why? I don't know. I probably should have
just added the new fields to the end of the file.
Then I used my normal technique of CPYF with NOCHK to populate the new
file with data, leaving the new fields blank. Much to my surprise, this
changed all the timestamps to the date and time of the CPYF. I used
DFU to change only the date portion of the timestamp to reflect the
correct day, since we don't care about the time part.
This broke the PHP program, causing a fetch error. Now that I'm
thinking about it, the PHP program probably did not work before I
changed the dates.
PHP can open the file ok, but anything after that gets a fetch error:
*Warning*: db2_fetch_both() [function.db2-fetch-both
<
http://192.168.1.200:88/dashboard/function.db2-fetch-both>]: Fetch
Failure in */www/sptserver/htdocs/dashboard/index.php* on line *8*
We can read the old file just fine.
I am guessing there is invalid data in the timestamp field.
So what is the magic with a timestamp field? Why did the timestamp
change in the first place from my copy? Did I create invalid data when
correcting it with DFU? How do I go about correcting a timestamp
field? How do I go about adding fields to a file with timestamp without
changing the stamp?
---Dale
As an Amazon Associate we earn from qualifying purchases.