View previous topic :: View next topic
|
Author |
Message |
manikandanjs
New User
Joined: 02 Jun 2006 Posts: 27 Location: Blue Bell, PA
|
|
|
|
Hi,
The numeric value is stored in COMP-3 format in the file. we are facing problem in retreiving the value using reference modification. for example,
consider a file as below,
Code: |
123456..1235653432..23423423..
|
In the above file layout, 7th and 8th position are stored using COMP-3 format.
We are not able to retreive the value using vari(7:2). Is there any way to get the value using reference modification (do not use redifines or decleration). |
|
Back to top |
|
|
Vidusha
New User
Joined: 01 Feb 2006 Posts: 20 Location: Chennai
|
|
|
|
Hi,
Reference modification works only with data items whose usage is DISPLAY.
Vidusha |
|
Back to top |
|
|
manikandanjs
New User
Joined: 02 Jun 2006 Posts: 27 Location: Blue Bell, PA
|
|
|
|
Hi,
Is there any way to convert the reference modified Hex value to a decimal value (without using redifine or decleration).
Thanks,
Loganathan K |
|
Back to top |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
Hello,
It is not possible to retrieve it using reference modification because reference modification only works for alpahnumeric fields. You can try to move the whole thing into a PIC 9(n) then into a PIC X(n) (to avoid reference modification) then do reference modification on the PIC X(n) field.
Regards. |
|
Back to top |
|
|
Vidusha
New User
Joined: 01 Feb 2006 Posts: 20 Location: Chennai
|
|
|
|
Can you provide the layout of the file
If you have 7th and 8th position declared as COMP-3, then why do you want to use Reference modification
What yo want to achieve by using reference modification?
Vidusha |
|
Back to top |
|
|
manikandanjs
New User
Joined: 02 Jun 2006 Posts: 27 Location: Blue Bell, PA
|
|
|
|
hi,
my file size is 24000 bytes. In the middile some of the nemeric values are stored in COMP. To create an automation process of report we step into the reference modification approach were the user can give the starting position and length of the field in the PARM. With that details we tried to retreive the COMP value, but it is giving problem. Let me know if there is any query.
Thanks,
Manikandan J |
|
Back to top |
|
|
Vidusha
New User
Joined: 01 Feb 2006 Posts: 20 Location: Chennai
|
|
|
|
You cannot just convert comp-3 to displayable data using reference modification
You either need to move them to display usage item or
use redefinition
Vidusha |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Just use RM against the 01 level of the record. |
|
Back to top |
|
|
manikandanjs
New User
Joined: 02 Jun 2006 Posts: 27 Location: Blue Bell, PA
|
|
|
|
Hi William,
I'm not getting what is meant by RM. Could you please give an example for the same?
Thanks,
Manikandan J |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Reference Modification.......... |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
First you say comp-3 then comp, which is it, they are completely different formats.
For comp-3.
Code: |
ws-number pic s9(3) comp-3.
move vari(7:2) to ws-number (1 : 2).
For comp.
ws-number pic s9(4) comp.
move vari(7:2) to ws-number (1 : 2).
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you have a 24000 byte record, i suspect there is a copybook for it. Why not use the field-name in the copybook? IMHO, it is a rather terrible approach using reference modification for a 24000 byte record. . . Mercy, what will happen when the field at byte 1000 has a length increase of 2 - it will make all of the displacements beyond that invalid.
If you post what you actually want to accomplish (rather than asking how to use reference modification for this packed/binary data), we may be able to help. |
|
Back to top |
|
|
|