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

converting numeric to packed decimal


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

New User


Joined: 05 Apr 2006
Posts: 11
Location: Bangalore

PostPosted: Fri Feb 17, 2012 7:00 pm
Reply with quote

Hi,

I need to convert a numeric to a packed decimal format before loading this data to a table.

my input file is like,
Code:
---+----4----+----
** Top of Data ***
45.92             
35.05             
26.04             
6.60             
8.25             
35.28             


the input file is 18byte length, i need to convert this to a packed decimal of lrecl 10.

after conversion i will be loading this packed decimal data to a table, where in the table the column is declared as packed decimal(18, 3)

any sort help please?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Feb 17, 2012 7:03 pm
Reply with quote

We assume you are using SYNCSORT. Is that correct?
Back to top
View user's profile Send private message
pawan_kch

New User


Joined: 05 Apr 2006
Posts: 11
Location: Bangalore

PostPosted: Fri Feb 17, 2012 7:05 pm
Reply with quote

Yes, we are using SYNCSORT
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Sat Feb 18, 2012 12:06 am
Reply with quote

pawan,

Try this code.

Code:

//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SORTIN DD *                                                           
45.92                                                                   
35.05                                                                   
26.04                                                                   
6.60                                                                   
8.25                                                                   
35.28                                                                   
//SORTOUT  DD DSN=B1CDTB2.TEST.PDVALUES,DISP=(,CATLG,DELETE),           
//            UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)                         
//SYSIN DD *                                                           
  OPTION COPY                                                           
  OUTREC FIELDS=(1,5,UFF,TO=PD)                                         


Copybook:-

Code:

****** ***************************** Top of Data ************
000001        01 REC1.                                       
000002           05 FIELD1   PIC 9(2)V99 COMP-3.             
****** **************************** Bottom of Data **********


File - Aid
Code:

FIELD1                                                                     
3/P                                                                       
(1-3)                                                                     
1-------                                                                   
********************************* TOP OF DATA **********************-CAPS O
   45.92                                                                   
   35.05                                                                   
   26.04                                                                   
    6.60                                                                   
    8.25                                                                   
   35.28       



Thanks
-3nadh
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 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 Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top