Get answers.  Share knowledge.  Collaborate with peers.




SQL creating an unwanted duplicate of file

it wasn’t discovered for an hour, but looking back as far as we can see the only thing that was done on that session was the SQL update. It is most vexing!



View Discussion   |  April 18, 2013  4:04 PM
DB2, SQL statement
discussed by:
BigKat
7,185 pts.

SQL creating an unwanted duplicate of file

Half of my discussion responses are now disappearing!!!

Sounds like you’re certain that the problem started at the time of the SQL.
I’m sure you checked the creation date on both versions of the file.



View Discussion   |  April 18, 2013  3:55 PM
DB2, SQL statement
discussed by:
philpl1jb
44,180 pts.

SQL creating an unwanted duplicate of file

And the copy couldn’t have existed before the SQL’s, perhaps long before ???
Cause your program are acting screwy with two copies of the data???
Whats the create date on the inappropriate one?



View Discussion   |  April 18, 2013  3:48 PM
DB2, SQL statement
discussed by:
philpl1jb
44,180 pts.

SQL creating an unwanted duplicate of file

we tend to do select statements to verify the where criteria is for the records we want and any calculated result will be what we want, then run the update… and it makes no sense that the update would do it, but job logs show he didn’t create it any other “reasonable” method.



View Discussion   |  April 18, 2013  3:33 PM
DB2, SQL statement
discussed by:
BigKat
7,185 pts.

Position at which value is entered in a subfile

If by position you mean SFL relative record number .. then if you have the
F spec SFILE(recformat:rrnfield).

The rrnfield will contain the SFL relative record number that relates to the most recent successful READC.

Phil



View Discussion   |  April 18, 2013  3:28 PM
AS/400, AS/400 Subfiles
discussed by:
philpl1jb
44,180 pts.

SQL creating an unwanted duplicate of file

no .. I’ve never seen an Sql UPDATE create a copy of a file.

However, I wouldn’t run an update without creating a copy of the file….



View Discussion   |  April 18, 2013  3:22 PM
DB2, SQL statement
discussed by:
philpl1jb
44,180 pts.

Date conversion

BigKat
That’s cool!
.. and change my *mdy0 to *dmy0
… In the discreate conversion each step could be monitored seperately so that we would know which date was invalid… but I’m sure the OP never has a bad date.
Phil



View Discussion   |  April 18, 2013  2:54 PM
AS/400, AS/400 Fields
discussed by:
philpl1jb
44,180 pts.

Message subfile

Also the article you reference is NOT saying APIs have bugs, rather that the API was reporting back an error in how the API was called (bad or inconsistent parameter values, the article didn’t really say that I noticed). The bug was in the user code not checking if the API was reporting an error — which is what the remainder of the article addressed (how to check for errors).

An analogy would be a RPG program doing a CHAIN with indicator 99 specified for Record not found and then having the RPG program not check if *in99 was on after the chain operation. This would not be considered a RPG compiler or run-time defect



View Discussion   |  April 18, 2013  2:22 PM
AS/400, MSGF, QMHSNDPM
discussed by:
bvining
6,055 pts.

Message subfile

Is the code under development small enough to send me a copy (along with anything needed to run it)? The initial problem sounded like some routine in the code stomping on storage, the new problem sounds like the wrong call stack entry is being referenced. In any case, I’ll try to take a look if you can send it to me at bvining@brucevining.com (though no promises on when I’ll get to it)

As Tom mentioned, QMHSNDPM is a very heavily used API. So I really doubt that you have found such a strange series of bugs in the API itself



View Discussion   |  April 18, 2013  2:13 PM
AS/400, MSGF, QMHSNDPM
discussed by:
bvining
6,055 pts.

Date conversion

doh! the last “endif” should be “endmon”



View Discussion   |  April 18, 2013  1:58 PM
AS/400, AS/400 Fields
discussed by:
BigKat
7,185 pts.

Date conversion

monitor;
If %date(wISODateA : *dmy0 )>= %date(wISODate : *iso0)and %date(wISODateA : *dmy0 )<= %date(wISODate2 : *iso0);

endif;
on-error *all;

endif;



View Discussion   |  April 18, 2013  1:58 PM
AS/400, AS/400 Fields
discussed by:
BigKat
7,185 pts.

Access 2007 query with null values

Could you give us a sample of some data from the original file and the desired output. Make the data representative of the range of issues.
tks Phil



View Discussion   |  April 18, 2013  1:14 PM
Microsoft Access 2007, Microsoft Access query
discussed by:
philpl1jb
44,180 pts.

Date conversion

It seams like this would work. Unless I’m confused again….
.
Create all three fields wDate1, wDate2, wDateA as date types
.
eval wDAte1 = %date(wISODate : *iso0)
eval wDAte2 = %date(wISODate2 : *iso0)
eval wDAteA = %date(wISODateA : *mdy0 )
If wDateA >= wDate1 and wDateA <= wDate2
.
.
But I would put it in a monitor block because if any of the character fields don't contain a valid date the function will throw an error.
.
Phil



View Discussion   |  April 18, 2013  1:02 PM
AS/400, AS/400 Fields
discussed by:
philpl1jb
44,180 pts.

Transfer AS/400 to Excel

First, are you expecting to create an Excel file, or do you intend to create .CSV files? — Tom



View Discussion   |  April 18, 2013  12:49 PM
AS/400, Microsoft Excel 2010
discussed by:
TomLiotta
108,055 pts.

Key list in AS/400

“Option 3. Use embedded SQL”
.
SQL doesn’t allow a CHAIN operation.
.
Tom



View Discussion   |  April 18, 2013  12:43 PM
AS/400, AS/400 logical file
discussed by:
TomLiotta
108,055 pts.

2 Dimensional Array in RPGLE

Without an example, I don’t know what you mean by “search any element using %lookup”. Generally, you don’t do lookups on multi-dimensional arrays. But if you’re asking about a kind of alternating array, then yes, you can do lookups on them.
.
Show your array definition and describe what is in it. Then describe how you need to search through it.
.
Tom



View Discussion   |  April 18, 2013  12:39 PM
iSeries RPGLE, RPGLE array
discussed by:
TomLiotta
108,055 pts.

My Unix command

And is the problem solved already or not? If the answer is yes what was the solution. It is nice toe share the solution for users who have the same problem



View Discussion   |  April 18, 2013  12:28 PM
Unix, Unix administration
discussed by:
jackieserver
180 pts.

My Unix command

Are you sure that the file exist and is on that place?



View Discussion   |  April 18, 2013  12:26 PM
Unix, Unix administration
discussed by:
jackieserver
180 pts.

Transfer AS/400 to Excel

You can create a single CL program that to do the transfers. IT is still one file at a time, Or that one CL program could submit multiple batch jobs.
What process are you using today to do the transfers?



View Discussion   |  April 18, 2013  12:24 PM
AS/400, Microsoft Excel 2010
discussed by:
CharlieBrowne
32,855 pts.

RSYNC hangs without reason

The CPU drops down to 2% normally a 15% during the operation. I watch the last modify date and it was 5 days before i start the back-up. I don’t know the problem but I had restart the operation and after checking for change files rsync reach that one file where it hangs but this time it just back-up it without any problem and the back-up operation. Maybe the reason was the virtual machine. It could be that this machines network interface had some problems when it runs on maximum for hours



View Discussion   |  April 18, 2013  12:23 PM
Debian, Linux
discussed by:
jackieserver
180 pts.