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
 

 

convert packed decimal to readable form using EDIT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: convert packed decimal to readable form using EDIT
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    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Tue Oct 18, 2011 10:11 pm    Post subject: Re: convert packed decimal to readable form using EDIT
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Tue Oct 18, 2011 10:15 pm    Post subject: Reply to: convert packed decimal to readable form using EDIT
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    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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


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