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

SOC-7 with COMP-3 move


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

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Sat Oct 20, 2007 10:57 pm
Reply with quote

I am moving the data from file
to comp-3 but end up with soc-7.
please help me on this?


var-1 PIC x(09).
var-2 PIC S9(10)V9(06) COMP-3.

data in var1. with hex on ->
Code:
....Í.Ï.<
000073704
00005173C


read file.

initialize var-2
display var-1. (Displaying as " Í Ï <")
display var-2. (Displaying as "0000000000000000")
MOVE var-1 ( has data from the file)
TO var-2 ( getting SOC-7 in this move)
Back to top
View user's profile Send private message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Sat Oct 20, 2007 11:27 pm
Reply with quote

i think the var-1 should be PIC 9(09).
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: Sun Oct 21, 2007 1:59 am
Reply with quote

Hello,

If your "var-1" contains the HEX ON value you posted, the content is already a comp-3 value. . .

Quote:
i think the var-1 should be PIC 9(09).
Not for this example.

If the content is as posted, pic 9(9) is not the correct definition - pic s9(17) comp-3 is the correct difinition for that value. The value posted shows 17 digits and a "positive" sign ("C").

As a hint, note that when posting code or data and you want to improve the readability as well as preserve the alignment when seen on the forum, you can use the "Code" tab near the top of the Reply panel ( the initial post has been updated to demonstrate). When you post code or data, you can enter your post and then click Preview. When you are satisfied with how your post will appear to the forum, click Submit.
Back to top
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Mon Oct 22, 2007 3:08 pm
Reply with quote

Thanks for the suggestions. I will take care of my further postings for better readability.

In my case I was reading from a file and which has a COMP-3 value.

I found a solution by trial and error.

var-1 PIC x(09).
01. var-2.
05 var-2-temp PIC S9(10)V9(06) COMP-3.

Move var-1 to var2.

This will move COMP-3 value.
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: Mon Oct 22, 2007 7:15 pm
Reply with quote

Hello,

You have a misunderstanding. You do not have a long-term, workable solution.
Quote:
I found a solution by trial and error.
What you found is a way to make this particular situation work.

Quote:
This will move COMP-3 value.
No, it will not move a comp-3 value. It will move the characters in the pic x field to another x field (a group field is a pic x field, and cannot be a comp-3 field - there mey be comp-3 items under a group, but the group is always alphanumeric).

It will be a good investment of your time to further investigate the movement of one field type to another.
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 COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts How to move DB2 Installation HLQ DB2 4
Search our Forums:

Back to Top