View previous topic :: View next topic
|
Author |
Message |
pawan_kch
New User
Joined: 05 Apr 2006 Posts: 11 Location: Bangalore
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
We assume you are using SYNCSORT. Is that correct? |
|
Back to top |
|
|
pawan_kch
New User
Joined: 05 Apr 2006 Posts: 11 Location: Bangalore
|
|
|
|
Yes, we are using SYNCSORT |
|
Back to top |
|
|
bodatrinadh
Active User
Joined: 05 Jan 2007 Posts: 101 Location: chennai (India)
|
|
|
|
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 |
|
|
|