View previous topic :: View next topic
|
Author |
Message |
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
Itanium
Active User
Joined: 22 Jan 2006 Posts: 114 Location: India
|
|
|
|
i think the var-1 should be PIC 9(09). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|