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

Moving packed Non-Integer value to Alphanumeric


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

New User


Joined: 07 Feb 2007
Posts: 22
Location: hyderabad

PostPosted: Wed Feb 07, 2007 12:11 pm
Reply with quote

"NEW-POSTL-RATE (PACKED NON-INTEGER)" and "WS-NEW-VALUE-FILE2 (ALPHANUMERIC)" did not follow the "MOVE" statement compatibility rules. The statement was discarded.

WHAT IS THE SOLUTION IN THE ABOVE CASE?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Feb 07, 2007 12:29 pm
Reply with quote

Hi Srikar,

Please provide the defination of the variables
Back to top
View user's profile Send private message
srikar tenali

New User


Joined: 07 Feb 2007
Posts: 22
Location: hyderabad

PostPosted: Wed Feb 07, 2007 2:13 pm
Reply with quote

thank you for the response

this is the definition for the given variables.

15 NEW-POSTL-RATE PIC S9(3)V9(2) COMP-3.

01 WS-OLD-VALUE-FILE1 PIC X(20) VALUE SPACES.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Wed Feb 07, 2007 2:23 pm
Reply with quote

srikar tenali wrote:
"NEW-POSTL-RATE (PACKED NON-INTEGER)" and "WS-NEW-VALUE-FILE2 (ALPHANUMERIC)" did not follow the "MOVE" statement compatibility rules. The statement was discarded.
WHAT IS THE SOLUTION IN THE ABOVE CASE?
Look in the Fine Manual for the "MOVE" statement compatibility rules.
Back to top
View user's profile Send private message
bharath_rudra

New User


Joined: 07 Feb 2007
Posts: 1
Location: hyderabad

PostPosted: Wed Feb 07, 2007 2:31 pm
Reply with quote

MOVE THE VARIABLE S9(3)V9(2) COMP-3 TO 9(3)V9(2) COMP-3
AND THEN
MOVE IT TO THE ALPHANUMERIC VARIABLE.
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: Wed Feb 07, 2007 8:43 pm
Reply with quote

Hello,

You might want to repost that - they should NOT both be comp-3. That will generate the same error. The compiler won't know one of the comp-3 fields from the other.

My guess is that you meant for the second field to be 9(3)V99.

Keep in mind that when you move that zoned decimal field to the alphanumeric field you will lose the implied decimal and you may not like the alignment of the resulting field. As a rate field, it will probably never be negative, but if you used the above method, you would also lose the sign. Run it in your code, display the alphanumeric field and make sure the result is what you want. When you do the display place marks on each side of the alpha field so you can see the true placement.

If you post some "real" data and how you want it to be in the alpha field, we can better help.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Feb 09, 2007 7:11 am
Reply with quote

Hi Srikar,

Adding to what Dick said, the blanks you see between the marks may not in fact be spaces.

So when you look at the DISPLAY data in SDSF use "se" instead of "s" when you select the sysout. Then enter "hex on" in the cmd line. This will show you the hex value of the display line. Hex "40" is a space.

Also please tell us how you intend to use the alpha data.
Back to top
View user's profile Send private message
srikar tenali

New User


Joined: 07 Feb 2007
Posts: 22
Location: hyderabad

PostPosted: Mon Feb 12, 2007 12:10 pm
Reply with quote

The above problem is solved by using

MOVE S9(3)V9(2) TO 9(3).9(2)
MOVE 9(3).9(2) TO X(20)

BY USING ABOVE METHOD, IT ISNT GIVING ANY ERRORS.

BUT WHILE TRYING TO SUB JCL, IT IS GIVING System Completion Code=0C7

DOES THIS HAS ANY ISSUE WITH THE ABEND?
Back to top
View user's profile Send private message
ralph_v

New User


Joined: 07 Jul 2005
Posts: 27

PostPosted: Mon Feb 12, 2007 3:46 pm
Reply with quote

I tried the above steps and it is working fine for me without any abends.

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Mon Feb 12, 2007 3:51 pm
Reply with quote

srikar tenali wrote:
BUT WHILE TRYING TO SUB JCL, IT IS GIVING System Completion Code=0C7
DOES THIS HAS ANY ISSUE WITH THE ABEND?
Probably not, but maybe so. I don't recall submission alone resulting in an 0C7, probably bad data..... icon_confused.gif
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 Feb 12, 2007 8:06 pm
Reply with quote

Hello,

Please post the "sysout" where the error occurred - it may be in multiple places in your output.

Please post the data that caused the 0c7. For example - did the program run for some number of records or did it abend on the first record?

I believe what you've told us is that you had no errors in the compile. That does not mean the problem is solved.

Job submission of your jcl will not cause an 0c7, but having non-numeric data in a number field will. As you continue with this, you might place a numeric test before the moves and detect/display any non-numeric data.
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 PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts Select a DB2 value in a specific deci... DB2 4
Search our Forums:

Back to Top