View previous topic :: View next topic
|
Author |
Message |
tarunbhardwajleo
New User
Joined: 23 Feb 2007 Posts: 25 Location: Dallas, TX
|
|
|
|
I have 3 kinds of records in my file - type 10, type 20 and type 30. Type of record is present in the first 2 bytes of the record. I have a single type 30 record that contains a numeric of 8 bytes with leading zeros compressed starting from position 3 till position 10 in the record. My task is to convert this 8 byte numeric field into a packed decimal of 5 bytes, thats S9(9) comp-3. I just need to convert the type 30 record. The remaining type 10 and type 20 records need not be converted. I would prefer to use sort (PGM=SORT) if possible.
Thanks in advance !
Sample data in the file looks like:
Code: |
101999-12-30-23.38.22.113649
205319390000001016 DV ....NN
209000001360121007 BP ....YN
206111210000001014 BP ....YN
30 104
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. Since you're going from an 8-byte field to a 5-byte field, I overlaid 3 blanks after the 5-byte field.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB)
//SORTOUT DD DSN=... output file (FB))
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'30'),
OVERLAY=(3:3,8,FS,TO=PD,LENGTH=5,3X))
/*
|
|
|
Back to top |
|
|
tarunbhardwajleo
New User
Joined: 23 Feb 2007 Posts: 25 Location: Dallas, TX
|
|
|
|
Hi Frank,
Thanks for the reply... Iam sorry, I forgot to mention that our shop doesn't have DFSORT. Can we use the same code using PGM=SORT ? But in that case I think that the overlay parameters might vary..... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can we use the same code using PGM=SORT ? |
PGM=SORT or PGM=ICEMAN invoke the sort product at your site (DFSORT, Syncsort, CA-SORT).
I don't know if this will work with Syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. |
|
Back to top |
|
|
|