View previous topic :: View next topic
|
Author |
Message |
HK_Endeavour Forever
New User
Joined: 15 May 2012 Posts: 5 Location: INDIA
|
|
|
|
Hello,
I am trying to convert a packed decimal (S9(7)V99) value to decimal using JCL SYNCSORT. I have tried the EDIT= option and various other options but I am getting a S0C7 error.
In Image1, From Column 63 till Column 66, Data is in packed decimal format. (S9(7)V99)
Image 2 ==> Hex ON and Cols on. From Column 63 till Column 66.
In first record, I want the field to be converted to decimal format.
so as an example I want to format the record and change it to show the field value as 0000347.00
Similarly on the second record, I want to format the record and change it to show the field value as 0006695.00.
Is this possible through JCL and SYNCSORT? The sign value should be preserved while converting the data.
Can anyone please advise?
JPEG ATTACHMENTS DELETED, USE A PLAIN TEXT CUT AND PASTE WITH THE BBCODE TAGS ! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
packed decimal (S9(7)V99) |
is 5 bytes not 4.
syncsort goes in JCL forum not icetool.
and stop with the jpg's.
uses much to much space and screws-up the page display.
learn about BBcode
you are a new member, read the faqs and learn about packed-decimal.
what did you think was in column 67? you left off the units and sign part of your numeric. |
|
Back to top |
|
|
HK_Endeavour Forever
New User
Joined: 15 May 2012 Posts: 5 Location: INDIA
|
|
|
|
Oops! My apologies! Yes, the data is of length 5 in packed format and starts at Column 63 till Column 67
ø
00370
0040C
Ñ&
00650
0690C
I am trying to reformat the record by changing this value to a decimal or displayable form 00003470.00 in first example and 00066950.00 in second example while at the same time preserving the sign value.
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,62,63:63,5,PD,M2)
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,62,63:63,5,PD,EDIT=($II,III,IT.TT))
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,62,63:63,5,PD,EDIT=(IIIIIIIT.TT),SIGNS=(,-,,))
I am receiving a S0C7 error. Can you please help?
This is the message in abend report "A decimal digit or sign was invalid." |
|
Back to top |
|
|
rakesha.hg
Active User
Joined: 21 Mar 2008 Posts: 161 Location: bangalore
|
|
|
|
hi,
How about using "To=ZD/PD/BI" & "length=" options in conjunction with your edit parameter ?? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
a Soc7 error is generated based on non-numerics in a source field.
redefinition of output field is a waste of time and shows an ignorance of the problem.
you should probably verify that the 'packed-decimal' field is numeric,
before you attempt to use it. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You are showing correct packed-decimal data in your two examples.
Is your file VB? Have you allowed the the RDW, so added for for the start position of all fields? |
|
Back to top |
|
|
HK_Endeavour Forever
New User
Joined: 15 May 2012 Posts: 5 Location: INDIA
|
|
|
|
Hello Dick,
The issue got fixed. Thank You for suggesting to check the data. I tried investigating all the records and found some records which were not in packed decimal format.
I removed those records and used the below sort card and it is working fine now.
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,62,63:63,5,PD,EDIT=(SIIIIIIT.TT),SIGNS=(,-,,))
00370
0040C
Converted to 347.00
00650
0690C ==> 6695.00
Similarly
00588
0064D ==> -568.48
Thank You Everyone for your advises!!
However I have observed that spaces change to 4040404.04. Is there any way to overcome spaces changing to value 4040404.04?
Thank You!! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
An IFTHEN and OVERLAY I guess. |
|
Back to top |
|
|
HK_Endeavour Forever
New User
Joined: 15 May 2012 Posts: 5 Location: INDIA
|
|
|
|
Thanks Bill.. I will try! |
|
Back to top |
|
|
|