View previous topic :: View next topic
|
Author |
Message |
mftechie123
New User
Joined: 20 Jan 2015 Posts: 3 Location: India
|
|
|
|
Hi,
I have an input file having below fields
X pic 9(10)
Y pic 9(15)
Z pic 9(9)
I need to convert the above fields into signed packed decimal for 2 fields Y and Z and X as Binary format.
INput file doesnt have any signs. THis needs to be converted before passing to further existing downstream process in mainframe.
I tried converting the above fields, but PD values are populated as F, but it should be C.
I tried using below logic.
OUTREC=(1,10,ZD,TO=BI,11,15,ZD,TO=PD,26,9,ZD,TO=PD)
Could you please suggest me how to do this logic using DFSORT. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Both C and F signs are positive, and it would be pretty dumb if the downstream process actually complained about it. PL/I definitely wouldn't. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
For COBOL there is compile option NUMPROC. If using NUMPROC(PFD), which generates less code, you have to guarantee that data conforms to PICture.
Can you show some sample input and expected output and what you are actually getting. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
DFSORT Application Programming Guide wrote: |
TRAILERx, HEADERx, BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to use new TO=PDF and TO=PDC options to convert numeric values to PD values with F or C for the positive sign, respectively. The TO=PDC option is equivalent to the existing TO=PD option. |
So, according to the documentation, you should have a sign (unless you have a version of DFSORT older than V1R13). |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
...equivalent to the existing TO=PD, so DFSORT has been like that since TO=PD existed.
SyncSort, however, has a TO=PDC which gives a different result to TO=PD. So, I suspected SyncSort... and think I'll move it along. |
|
Back to top |
|
|
mftechie123
New User
Joined: 20 Jan 2015 Posts: 3 Location: India
|
|
|
|
Input file has
Column 1 to 10 has tobe converted to Binary
Column 11 to 25 has tobe converted to Packed decimal
Last column is also to be converted to Packed decimal.
0922489216012240000000096001224118
2004374016012240000000097001224119
0705605376012240000000098001224120
Output file in hexdecimal format..
3F180240000601218
6C101200009F0241F
77500240000701219
78201200009F0241F
20A00240000801210
AEF01200009F0242F
I can able to convert into Binary format. But PD is getting the value as F in sign portion. Suggest me how to get 'C' in sign bit. |
|
Back to top |
|
|
mftechie123
New User
Joined: 20 Jan 2015 Posts: 3 Location: India
|
|
|
|
Thanks Bill!! I tried using TO=PDC, Now I got C in sign bit. Thanks a lot for your help. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Next time, put your Syncsort questions in the Syncsort section ! |
|
Back to top |
|
|
|