Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using reference modification on COMP-3 variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Using reference modification on COMP-3 variable
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Jun 08, 2007 4:10 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Jun 08, 2007 4:51 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jun 08, 2007 9:52 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us