|
View previous topic :: View next topic
|
| Author |
Message |
sravanv
New User

Joined: 02 Aug 2005 Posts: 13 Location: hyderabad
|
|
|
|
HI FRIENDS,
CAN U PLEASE GIVE ME A JCL OF CONVERTING ZD TO PD?
I HAVE A VALUE OF 109.86 .CAN U PLEASE HELP ME IN CONVERTING THIS VALUE INTO PACKED DECIMAL?
THANKS & REGARDS
SRAVAN |
|
| Back to top |
|
 |
jz1b0c
Active User

Joined: 25 Jan 2004 Posts: 160 Location: Toronto, Canada
|
|
|
|
Hi this JCL will work out,
Zd field == 9(3)v9(2)
PD field == 9(11)v9(2) you can receive it into any format
The sort card is working well for implied decimals, if you have a cobol field as 9(3).9(2), the suggested sort doesn't work.
for input output layout's check the attachment
//STEP020 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=JZ1B0C.TEST.FILE1,DISP=SHR
//SORTOUT DD DSN=JZ1B0C.TEST.FILE2,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(80,(80,10),RLSE),LRECL=80
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,5,
10:6,5,ZD,PD,LENGTH=7,
20:12,50)
/*
//* |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Sravan,
You need to be clearer about what your input field looks like and what you want your output field to look like.
Is the 109.86 value a character value '109.86' - if so, what is the position and length of the field? Note that you can't use ZD for a value with an actual decimal point, but you can use DFSORT's UFF format, e.g. if the "ZD" values are 'ddd.dd' values starting in position 21, you could use these DFSORT control statements to convert them to 6-byte PD values.
| Code: |
OPTION COPY
INREC OVERLAY=(21:21,6,UFF,TO=PD,LENGTH=6)
|
Or is the 109.86 some other type of value, e.g. an internal value without the decimal point - if so, what is the position and length of the field and what does it look like in hex?
PD values do NOT have decimal points although the decimal point can be implied, e.g., '109.86' can be stored as a PD value of X'10986C' but any application that uses the PD value has to know about the implied decimal point. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|