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
 

 

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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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