The message is:
I know 0C7 is a data error, but how can i read PSW abend code?
The PSW is not and does not contain an abend-code, it shows the processor state at the time of the abend.
The PSW in your example has 8 bytes, so it's in ESA/390 format (in 64-bit-mode the PSW is 16 bytes), so I' focus on that case.
Usually the only thing that matters when investigating a 0C7 abend is the last 31 bits that contain the NSI - the next sequential instruction - pointing to the machine-statement after the statement causing the exception. In your case would be the address 60009260. You'd have to investigate the statement before that address to see what data it is using and then investigate why it is not in the correct format.
On the other hand the shown PSW starts with FF - which should never be the case (see below), so the value shown is probably corrupted and the NSI-value should also be treated with a certain amount of suspicion.
To answer the question as stated here's the complete PSW-layout (all offsets and lengths are for bits):
offset 0, length 1: always 0 (1in your example!!!)
offset 1, length 1: Program Event Recording flag
offset 2, length 3: always 000
offset 5, length 1: dynamic address translation flag
offset 6, length 1: IO-interruptions flag
offset 7, length 1: external-interruptions flag
offset 8, length 4: PSW-Key (compared with storage-key for storage protection)
offset 12, length 1: always 1
offset 13, length 1: machine-check-interruptions flag
offset 14, length 1: wait-state flag
offset 15, length 1: problem-state flag
offset 16, length 2: address-space control
offset 18, length 2: condition code (set e.g. by compare-instructions)
offset 20, length 4: program mask (set e.g. by arithmetic instructions on overflow)
offset 24, length 1: IBM-reserved
offset 25, length 6: always 000000
offset 31, length 1: extended-addressing-mode flag (1 means 64-bit-addressing)
offset 32, length 1: basic.addressing-mode flag (1 means 31-bit-addressing as opposed to 24-bit)
offset 33, length 31: next sequential instruction
Further details on the meaning of the various flags as well as the layout of the 64-bit PSW can be found in the "Control"-chapter of the "z/Architecture Principles of Operation" manual.
Below query gives 2 different wrong length but same numbers ,In IBM db2 SQL
Why there is 2 different length for same value ?
select
decimal(TRIM(cast(15 as char(2)))||TRIM(LPAD(cast(7 as char(2)),2,'0'))||TRIM(LPAD(cast(13 as char(2)),2,'0'))),
length(decimal(TRIM(cast(15 as char(2)))||TRIM(LPAD(cast(7 as char(2)),2,'0'))||TRIM(LPAD(cast(13 as char(2)),2,'0')))),
decimal(TRIM(substr(replace(char(current_date -1 days,ISO),'-',''),3,6)),6,0),
length(decimal(TRIM(substr(replace(char(current_date -1 days,ISO),'-',''),3,6)),6,0))
from sysibm.sysdummy1
These numbers are not the same value the first one is 15713 and the second is 150713.
DECIMAL(x,p,s) returns a packed decimal value of precision p, scale s.
A packed decimal(p,s) only takes p/2 + 1 bytes of memory.
So 6 /2 + 1 = 4, which is the value LENGTH() returns for packed decimal expressions per the (DB2 for IBM i) manual
My question is probably really easy, but I am a mathematica beginner.
I have a dataset, lets say:
Column: Numbers from 1 to 10
Column Signs
Column Other signs.
{{1,2,3,4,5,6,7,8,9,10},{d,t,4,/,g,t,w,o,p,m},{g,h,j,k,l,s,d,e,w,q}}
Now I want to extract all rows for which column 1 provides an odd number. In other words I want to create a new dataset.
I tried to work with Select and OddQ as well as with the IF function, but I have absolutely no clue how to put this orders in the right way!
Taking a stab at what you might be asking..
(table = {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} ,
Characters["abcdefghij"],
Characters["ABCDEFGHIJ"]}) // MatrixForm
table[[All, 1 ;; -1 ;; 2]] // MatrixForm
or perhaps this:
Select[table, OddQ[#[[1]]] &]
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
The convention in Mathematica is the reverse of what you use in your description.
Rows are first level sublists.
Let's take your original data
mytable = {{1,2,3,4,5,6,7,8,9,10},{d,t,4,"/",g,t,w,o,p,m},{g,h,j,k,l,s,d,e,w,q}}
Just as you suggested, Select and OddQ can do what you want, but on your table, transposed. So we transpose first and back:
Transpose[Select[Transpose[mytable], OddQ[First[#]]& ]]
Another way:
Mathematica functional command MapThread can work on synchronous lists.
DeleteCases[MapThread[If[OddQ[#1], {##}] &, mytable], Null]
The inner function of MapThread gets all elements of what you call a 'row' as variables (#1, #2, etc.). So it test the first column and outputs all columns or a Null if the test fails. The enclosing DeleteCases suppresses the unmatching "rows".
MSDN says about precision and scale of decimal multiplicatuion result:
The result precision and scale have an absolute maximum of 38. When a result precision is greater than 38, the corresponding scale is reduced to prevent the integral part of a result from being truncated.
So when we execute this:
DECLARE #a DECIMAL(18,9)
DECLARE #b DECIMAL(19,9)
set #a = 1.123456789
set #b = 1
SELECT #a * #b
the result is 1.12345689000000000 (9 zeros) and we see that it is not truncated because 18 + 19 + 1 = 38 (up limit).
When we raise precision of #a to 27 we lose all zeros and the result is just 1.123456789. Going futher we proceed with truncating and get the result being rounded. For example, raising precision of #a to 28 results in 1.12345679 (8 digits).
The interesting thing is that at some point, with precision equal to 30, we have 1.123457 and this result won't change any futher (it stops being truncated).
31, 32 and up to 38 results in the same. How could this be explained?
Decimal and numeric operation results have a minimum scale of 6 - this is specified in the table of the msdn documentation for division, but the same behavior applies for multiplication as well in case of scale truncation as in your example.
This behavior is described in more detail on the sqlprogrammability blog.
How can I fix this error in T-SQL? The following line executes successfully:
SET #dPERCENT_QC_COMPLETED = CASE WHEN #NUM_QC_RECEIVED = 0
THEN 0
ELSE #NUM_QC_COMPLETED / #NUM_QC_RECEIVED
END
But this line fails with error code below:
SET #dPERCENT_QC_COMPLETED = CASE WHEN #NUM_QC_RECEIVED = 0
THEN 0
ELSE (100 * #NUM_QC_COMPLETED / #NUM_QC_RECEIVED)
END
Msg 8115, Level 16, State 8, Line 73
Arithmetic overflow error converting int to data type numeric.
#dPERCENT_QC_COMPLETED is a decimal(2). The other variables are integers. Problem I think is that currently these other integer values = 1, so this expression evaluates to 1.
decimal(2) is never going to able to cope with 100 percent complete. Why are you using that datatype?