View previous topic :: View next topic
|
Author |
Message |
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
There are three fields for below data, first is AAAZ(Char(4), second is 994EFH005(char(9)), the last is ........ (fixed(15,2), how can I know the last's decimal value?
and second question is why PLI use "C1" to represent "A", A's hex value should "41" since A's ascii code is 65, can some one help me?
Code: |
AAAZ994EFH005........
CCCEFFFCCCFFF00000000
11199945680050C000000 |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Hopefully, i've made the correct changes to your post. I could not tell if the info was done for a chat room, done with a faulty keyboard, or possibly i really misread or misunderstood. . .
Also, suggest you practice with the Code tag to preserve alignment ([/img] is not what you want ( i believe), so i Code'd the data.
It looks as though the data does not match the description. That "C" should probably be in the low-order nibble of the 8-bytes . . .
Quote: |
A's hex value should "41" since A's ascii code is 65, |
Huh
On an IBM mainframe, a capital A is always and only x'C1'. An x'D1' is always a J; a Z is an x'E9' and so on. Suggest you key the alphabet into a member and set HEX ON and see hex values just like you posted. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
Thanks for your help.
I just made a test that wrote 0 or 0.00 as fixed(15,2) type to a file,and I got the same result as follow
Code: |
........
00000000
0000000C
|
so what 's value for below
Code: |
........
00000000
0C000000
|
[/code] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Code: |
........
00000000
0C000000 |
is not fixed(15,2) type.
Suggest you find the actual data definition(s). The first bit (2 bytes) could be a fixed(3,2) field. The next 6 bytes could be one or more binary fields or something that was uninitialized (garbage) or something that was intentionally initialized to x'00's. You might discover what this is if you look at the process that created the data. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
The task I am working on is to use data reporter to find some row meet my requirement,
the copy book snippet I use as follow
Code: |
2*******
2 DATA(5),
5 SOLD FIXED(15,2),
2******
|
and the JCL snippet the DR created is
Code: |
DEF SOLD 1396-1403 P2
|
and I want to find rows with SOLD not equal to below value, it failed when I write "select SOLD ne 0" or "select SOLD ne 0.00", any suggestion, thx!
Code: |
........
00000000
0C000000
|
|
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
DEF SOLD 1396-1403 P2
|
is a code, not a JCL, snippet.
It looks like this is overlaying a P2-type field on an 8 byte field (1396-1403). This is consistent with DEC FIXED(15,2). You are mistaken if you think this refers to a 2 byte field beginning at the start location of SOLD.
Garry. |
|
Back to top |
|
|
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
Garry, below snippet is from the JCL generated from Datareporter
Code: |
DEF SOLD 1396-1403 P2
|
|
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
seman18,
Can you show the JCL generated (using code tags)? JCL statements begin with a double slash (//), and this line does not conform with that. This may be generated by Datareporter, but it sure ain't JCL.
My reading of the snippet shown is that the P2 refers to a packed field with 2 digits precision. The 1396-1403 indicates the location and length of the field within the record. Thus, the field occupies 8 bytes, is packed and has 2 decimal places - in other (PL/1) words, a decimal fixed(15,2) field.
Garry. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And if the "field" contains this:
Code: |
........
00000000
0C000000 |
it is an invalid packed-decimal value - it will cause an abend if used in a numeric operation. To work with this field, define it as an 8-byte alphanumeric and compare against the hex value x'000C00000000000000000000000000'. |
|
Back to top |
|
|
|