IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

TO GET THE CONTENT OF S9(09) COMP FIELD


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
a1javeed

New User


Joined: 10 Dec 2005
Posts: 20
Location: KUWAIT

PostPosted: Wed Jun 14, 2006 7:06 pm
Reply with quote

Hi
I have created a sequential file , in which i have a field defined as S9(09) COMP .When i tried to find the content of the field thru editing the file using UTILITIES of TSO it shows some different values than the actual one(when i put HEX ON ).Can anybody tell me ,How can i know the actual content of the field?
thanx
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Wed Jun 14, 2006 8:57 pm
Reply with quote

example of what you see and what the value really is?
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 15, 2006 5:04 pm
Reply with quote

You should know how to read the data in binary format . e.g.
1 in S9(04) COMP will be stored as 0000
0001
10 will be stored as 0000
000A
(A here means 10 )
16 will be stored as 0001
0000
32 will be stored as 0002
0000
42 will be stored as 0002
000A

Basically the numbers here are represented in hex format where the base is 16 not 2
So if you follow this convention, I hope you will find your data matching
Back to top
View user's profile Send private message
a1javeed

New User


Joined: 10 Dec 2005
Posts: 20
Location: KUWAIT

PostPosted: Thu Jun 15, 2006 6:15 pm
Reply with quote

Thank u very much
that's what i wanted to know icon_biggrin.gif
Back to top
View user's profile Send private message
manolera

New User


Joined: 16 Jun 2006
Posts: 1

PostPosted: Fri Jun 16, 2006 9:27 pm
Reply with quote

We are downloading a file from the mainframe to Unix, in binary format.
We are able to decode text fields as well as packed numbers.
We are facing problems with a field described as "Numeric (signed), expressed in units of 1. PIC S9(13).".
We find that the first 12 characters are a valid number.
We expect the 13th character to be a digit or the sign (+/-), but we actually find the following ten values:
"","A","B","C","D","E","F","G","H","I".
We are not sure how to interpret these values.

We are speculating that there is a mapping like the one shown below, where "B" is "+2" and "N" is "-4", but we would like to have some confirmation.

Code:

Sign:  |+|+|+|+|+|+|+|+|+|+|-|-|-|-|-|-|-|-|-|-|
Digit: |0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|
Result:||A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jun 16, 2006 11:19 pm
Reply with quote

PIC S9(13) is a 13-byte signed ZD field that is stored internally like this (hex):

zdzdzdzdzd...zdsd

z is the zone -> usually F
d is a digit -> 0-9
s is the sign indicator -> usually C or F for plus or D for minus.

So that last byte is usually one of the following:

C0-C9, D0-D9, F0-F9

That's why you see the characters you see (e.g. C1 = 'A').
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
Search our Forums:

Back to Top