Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SOC-7 with COMP-3 move

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: SOC-7 with COMP-3 move
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    Post subject: Reply to: SOC-7 with COMP-3 move
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

Site Director


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

PostPosted: Sun Oct 21, 2007 1:59 am    Post subject:
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    Post subject: Reply to: SOC-7 with COMP-3 move
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

Site Director


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

PostPosted: Mon Oct 22, 2007 7:15 pm    Post subject:
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    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 Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us