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

convert packed decimal to readable form using EDIT


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

New User


Joined: 10 Jan 2006
Posts: 1

PostPosted: Tue Oct 18, 2011 9:41 pm
Reply with quote

Hi ,

I am trying to convert Packed Decimal to Readable form and it hould have sign also but I am not sure where I am making mistake in my sort card. output file is getting default negative sign. I have provided the file information and sort card.


Input File :CORP.USER.MIS.PRODTYPE.FINAL1
-------------
VIEW CORP.USER.MIS.PRODTYPE.FINAL1
000001 1190A005 d )
FFFFCFFF0444440000038150444444
1190100550000000003243D5000000
----------------------------------------
000002 13J80328 n *
FFDFFFFF0444440000090150444444
1318032850000000000556C5000000
----------------------------------------
000003 14906125 lçÁ*
FFFFFFFF0444440000094650444444
1490612550000000002385C5000000

Sort Card Used:
------------------------
//STEP75 EXEC PGM=DFSORT
//SORTIN DD DISP=SHR,
// DSN=CORP.USER.MIS.PRODTYPE.FINAL1
//SORTOUT DD DSN=ECNS.PHCM800V.MIS.FORMAT.F1SEP50J,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=28,RECFM=FB)
//SYSUDUMP DD SYSOUT=C
//SYSIN DD *
SORT FIELDS=(COPY)
OUTREC FIELDS=(1:1,8,10:15,10,PD,EDIT=(SIIIIIIIIIIIIITT.TTI),
SIGNS=(,-))

Desired Output :
1190A005 -3328413.50
13J80328 -950516.5
14906125 -2934865.5

Actual Output:
----------------
1190A005 3328413.50
13J80328 -950516.5
14906125 -2934865.5
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Oct 18, 2011 9:52 pm
Reply with quote

i would suggest looking at the syntax for SIGNS=
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 18, 2011 10:11 pm
Reply with quote

Are you sure of the length of the PD? Looks like 9 to me. The first is negative, the remaining two are positive.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 18, 2011 10:15 pm
Reply with quote

Your understanding of Your data is just plain wrong or You posted the wrong data ...
after a bit of alignment Your data looks like
Code:
123456789012345678901234567890
1190A005            d )
FFFFCFFF0444440000038150444444
1190100550000000003243D5000000
----------------------------------------
123456789012345678901234567890
13J80328           n  *
FFDFFFFF0444440000090150444444
1318032850000000000556C5000000
----------------------------------------
123456789012345678901234567890
14906125           lç *
FFFFFFFF0444440000094650444444
1490612550000000002385C5000000
123456789012345678901234567890


the packed decimal is NINE bytes ... the x'05' which follows id a <tab>

here is what You get with Your card
Code:
********************************* TOP OF DATA **********************************
1190A005         -3328413.500                                                   
13J80328          -950516.5 0                                                   
14906125         -2934865.5 0                                                   
******************************** BOTTOM OF DATA ********************************


and here what You would get with a proper decoding of a PACKED number
Code:
********************************* TOP OF DATA **********************************
1190A005           -33284.135                                                   
13J80328             9505.165                                                   
14906125            29348.655                                                   
******************************** BOTTOM OF DATA ********************************


review Your issue and post proper data


and the output You posted cannot come from that data ...
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top