Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Packed Decimal to Decimal using JCL SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
HK_Endeavour Forever

New User


Joined: 15 May 2012
Posts: 5
Location: INDIA

PostPosted: Mon May 28, 2012 12:39 am    Post subject: Packed Decimal to Decimal using JCL SYNCSORT
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 28, 2012 2:10 am    Post subject:
Reply with quote

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
View user's profile Send private message
HK_Endeavour Forever

New User


Joined: 15 May 2012
Posts: 5
Location: INDIA

PostPosted: Mon May 28, 2012 9:28 am    Post subject:
Reply with quote

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
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Mon May 28, 2012 6:14 pm    Post subject: Reply to: Converting Packed Decimal to Decimal using JCL SYN
Reply with quote

hi,

How about using "To=ZD/PD/BI" & "length=" options in conjunction with your edit parameter ??
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 28, 2012 6:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon May 28, 2012 6:29 pm    Post subject: Reply to: Converting Packed Decimal to Decimal using JCL SYN
Reply with quote

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
View user's profile Send private message
HK_Endeavour Forever

New User


Joined: 15 May 2012
Posts: 5
Location: INDIA

PostPosted: Thu May 31, 2012 5:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu May 31, 2012 6:49 pm    Post subject: Reply to: Converting Packed Decimal to Decimal using JCL SYN
Reply with quote

An IFTHEN and OVERLAY I guess.
Back to top
View user's profile Send private message
HK_Endeavour Forever

New User


Joined: 15 May 2012
Posts: 5
Location: INDIA

PostPosted: Thu May 31, 2012 7:19 pm    Post subject:
Reply with quote

Thanks Bill.. I will try!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 3 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us