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
 

 

Moving packed Non-Integer value to Alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Moving packed Non-Integer value to Alphanumeric
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: 1187
Location: Bangalore,India

PostPosted: Wed Feb 07, 2007 12:29 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Feb 07, 2007 2:23 pm    Post subject: Re: Moving packed Non-Integer value to Alphanumeric
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    Post subject: Re: Moving packed Non-Integer value to Alphanumeric
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

Site Director


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

PostPosted: Wed Feb 07, 2007 8:43 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: Moving packed Non-Integer value to Alphanumeric
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: 3158
Location: Tucson AZ

PostPosted: Mon Feb 12, 2007 3:51 pm    Post subject:
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

Site Director


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

PostPosted: Mon Feb 12, 2007 8:06 pm    Post subject:
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    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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 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
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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