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
 

 

converting numeric to packed decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: converting numeric to packed decimal
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: 1788
Location: UK

PostPosted: Fri Feb 17, 2012 7:03 pm    Post subject:
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    Post subject: Reply to: converting numeric to packed decimal
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    Post subject: Reply to: converting numeric to packed decimal
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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