IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using reference modification on COMP-3 variable


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Fri Jun 08, 2007 10:42 am
Reply with quote

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
View user's profile Send private message
Vidusha

New User


Joined: 01 Feb 2006
Posts: 20
Location: Chennai

PostPosted: Fri Jun 08, 2007 10:56 am
Reply with quote

Hi,

Reference modification works only with data items whose usage is DISPLAY.

Vidusha
Back to top
View user's profile Send private message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Fri Jun 08, 2007 11:28 am
Reply with quote

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
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Fri Jun 08, 2007 11:51 am
Reply with quote

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
View user's profile Send private message
Vidusha

New User


Joined: 01 Feb 2006
Posts: 20
Location: Chennai

PostPosted: Fri Jun 08, 2007 12:15 pm
Reply with quote

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
View user's profile Send private message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Fri Jun 08, 2007 2:36 pm
Reply with quote

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
View user's profile Send private message
Vidusha

New User


Joined: 01 Feb 2006
Posts: 20
Location: Chennai

PostPosted: Fri Jun 08, 2007 4:07 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Jun 08, 2007 4:10 pm
Reply with quote

Just use RM against the 01 level of the record.
Back to top
View user's profile Send private message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Fri Jun 08, 2007 4:38 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Jun 08, 2007 4:51 pm
Reply with quote

Reference Modification..........
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 08, 2007 5:56 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 08, 2007 9:52 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top