View previous topic :: View next topic
|
Author |
Message |
sathiyendran.erulan
New User
Joined: 04 Mar 2009 Posts: 11 Location: chennai
|
|
|
|
Input file layout:
01 gruop
05 gr-name pic x(6).
05 gr-no pic s9(4) comp-3.
Input file:
----------
sathya10
niyama11
leksha12
Now i want that read the gr-no from the input file and stored to output file in the format of packed decimal.
output file should be:
sathya$$
niyama$$
leksha$$
Note : $$ is gr-no value of the input file in packed decimal format. when we verify the data with copy book it should be same.
I used the code as :
sort fields=copy
inrec fields=(1:1:06,07:07,04,to=pd,length=02)
I m not getting the correct value using the above code. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The data posted does not match the file definition. . .
The layout mentions comp-3 but the data is zoned. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Now i want that read the gr-no from the input file and stored to output file in the format of packed decimal. |
According to your layout, the gr-no is a 3-byte PD value. Is that really the case?
If you want to go from a 3-byte PD value to a 2-byte PD value, you would use:
7,3,PD,TO=PD,LENGTH=2
If you want something else, you need to show the correct input layout and expected output layout. |
|
Back to top |
|
|
sathiyendran.erulan
New User
Joined: 04 Mar 2009 Posts: 11 Location: chennai
|
|
|
|
The gr-no is s9(4) usage comp.I fetched the data through spufi and using that spufi file as my input file. When we look into the spufi it should be readble format.
I read that data for that field and stored into converted format(that is output file). When i give the output file to the corressponding copy book it does not match the value when using the above mentioned code.
So the intension is that comp value needs to converted into non-readble format to the output file. For verfication we gave the output file to the copy book it will show the proper value ( as it is taken from the spufi)
How can i convert the comp value into non-readble format ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
comp value needs to converted into non-readble format |
Code: |
01 gruop
05 gr-name pic x(6).
05 gr-no pic s9(4) comp-3. |
So, which is it - comp or comp-3? It realy, really does matter. . .
Also, how would you describe a "non-readble format"?
It will probably help if you show the sample data (input and output) in hex rather than what has been posted. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sathiyendran.erulan wrote: |
comp value needs to converted into non-readble format |
floating point?? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
sathiyendran.erulan,
You have described your "requirement" in such a confusing and contradictory way that nobody can help you.
As I said in my previous post:
Quote: |
If you want something else, you need to show the correct input layout and expected output layout. |
If you can't do that, then nobody can help you since we don't understand what it is you're trying to do. |
|
Back to top |
|
|
|