View previous topic :: View next topic
|
Author |
Message |
MKP
New User
Joined: 23 Aug 2006 Posts: 12 Location: Chennai
|
|
|
|
Hi ,
I having a file where the fields are Comp-3 and comp.
eg:
A pic 9(3)v99 comp-3.
B pic 9(4)v999 comp.
I need to convert the above fields to Display format.
How can i code it using DFSORT Convert option.
Thanks,
Muthu |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Use the following -
Code: |
OPTION COPY
OUTREC FIELDS=(1,3,PD,TO=ZD,LENGTH=5, * FOR COMP-3
4,7,BI,TO=ZD,LENGTH=7) * FOR COMP
|
|
|
Back to top |
|
|
MKP
New User
Joined: 23 Aug 2006 Posts: 12 Location: Chennai
|
|
|
|
Hi Murali,
My sysin is as below
Code: |
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(7,6,PD,TO=ZD,LENGTH=11) --> TRUNCATED AMOUNT
/* |
I got an output as
Code: |
9?24000000.
9?16000000.
|
But i need the output as
Code: |
240000000.00
160000000.00
|
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
IIRC, convert is used for variable to fixed format conversion.
It would help us all if you would post an example of your input and expected output. Please also include record length and format. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
If your file is a VB one, add 4 to the start column.
Also give the number of bytes occupied by the variable and not the size as per declaration. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Muthu,
To get an output value like:
240000000.00
You can use a DFSORT edit mask like this:
p,m,f,EDIT=(TTTTTTTTT.TT)
But it's not clear what your input field looks like. You describe a PD and a BI field but then show 7,6,PD. We don't know if the field actually starts in position 7 and if it's really a 6-byte PD field. We also don't know if your RECFM is FB or VB. You need to be more clear about what your input fields look like. Give the starting position, length and format of each field and the RECFM and LRECL of the input file. Show an example of an input record in hex if possible. Show what you want for output. |
|
Back to top |
|
|
MKP
New User
Joined: 23 Aug 2006 Posts: 12 Location: Chennai
|
|
|
|
The quoted statement
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(7,6,PD,TO=ZD,LENGTH=11) --> TRUNCATED AMOUNT
/*
is the real requirement and my input file is having two values which are in PD format [9(9)v99 comp3] starting position is 7. The input file type is FB and the output file type is FB.
Input file is having the values whose format is 9(9)v99comp3
240000000.00
160000000.00
output file should have the values whse format is 9(9)v99 or 9(9).99 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Then you can use these DFSORT statements:
Code: |
OPTION COPY
OUTREC FIELDS=(7,6,PD,EDIT=(TTTTTTTTT.TT))
|
|
|
Back to top |
|
|
MKP
New User
Joined: 23 Aug 2006 Posts: 12 Location: Chennai
|
|
|
|
Frank,
Thank you very much the code is working fine. |
|
Back to top |
|
|
|