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
 
data move to s9(4) comp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Wed Sep 22, 2010 9:12 am    Post subject: data move to s9(4) comp
Reply with quote

Could somebody help me out with the following query as i don't have access to mainframes to test it by myself.

Is the following correct .

Move X'001' to WS-A .
WS-A is defined in working storage with picture clause S9(4) comp.

Thanks
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 Sep 22, 2010 9:45 am    Post subject:
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals". Among them are the COBOL Language Reference for current compiler releases.

Suggest you read all about elementary moves.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Sep 22, 2010 5:47 pm    Post subject: Re: data move to s9(4) comp
Reply with quote

Ambili S wrote:
Could somebody help me out with the following query as i don't have access to mainframes to test it by myself.

Is the following correct .

Move X'001' to WS-A .
WS-A is defined in working storage with picture clause S9(4) comp.

Thanks


X'001' is 1 and 1/2 bytes and is not a valid value for a hex literal.
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 28, 2010 11:44 am    Post subject:
Reply with quote

Hi Craq ,

Then the below statement is valid ?

MOVE X'0001' to WS-A , where WS-A is defined with S9(4) comp .
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Sep 28, 2010 1:57 pm    Post subject:
Reply with quote

Ambili S wrote:
Hi Craq ,

Then the below statement is valid ?

MOVE X'0001' to WS-A , where WS-A is defined with S9(4) comp .


That statement will not get past syntax check, as the literal x'0001' is not compatible with the binary integer type of the comp field.
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: Tue Sep 28, 2010 9:54 pm    Post subject:
Reply with quote

Hello,

One should move numeric only values to fields that are defined as numeric.

If you simply must use x'0001', redefine the 9(4) comp field as pic xx and move the x'0001' to the pic xx field.
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Wed Sep 29, 2010 10:21 am    Post subject:
Reply with quote

Hi Dick

What i meant was can HEX values be used directly in move statememtns to comp fields ?
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Sep 29, 2010 12:48 pm    Post subject:
Reply with quote

Ambili S wrote:
Hi Dick

What i meant was can HEX values be used directly in move statememtns to comp fields ?

I have just answered you above that you will get a compiler error message if you move a literal x'0001' to a comp field.
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Thu Sep 30, 2010 12:30 am    Post subject: Couldn't you just do a numeric move
Reply with quote

Couldn't you just move a numeric 1 to WS-A ????

01 WS-A PIC S9(04) COMP.

MOVE 01 TO WS-A.

???
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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