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
 

 

Can i directly move S9(9) comp to S9(9) comp

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

New User


Joined: 21 Sep 2007
Posts: 6
Location: chennai

PostPosted: Tue Aug 12, 2008 10:27 am    Post subject: Can i directly move S9(9) comp to S9(9) comp
Reply with quote

I am reteving a Curr_Date date field from table which is defind as S9(9) comp (ccyymmdd). I want to move this field to another working storage variable WS-DATE which is also a S9(9) comp field in the format 000yymmdd. so my small doubt is can i move it directly as

MOVE Curr_Date(3:6) TO WS-Date(4:6).

Whether it will work or not. I know it's a silly doubt but i had so much of date logic in this program, that i confused little bit. icon_sad.gif

Thanks in advance,
Sam
Back to top
View user's profile Send private message

Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Tue Aug 12, 2008 11:15 am    Post subject:
Reply with quote

I have never seen reference modification used on comp variables.
I am under impression that this should be used for strings only. icon_biggrin.gif

Thanks,
Santosh.
Back to top
View user's profile Send private message
sam_duniya

New User


Joined: 21 Sep 2007
Posts: 6
Location: chennai

PostPosted: Tue Aug 12, 2008 11:24 am    Post subject:
Reply with quote

Can i have the other way of doing it..
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Tue Aug 12, 2008 11:41 am    Post subject:
Reply with quote

Yes.

Move Curr_Date to the ws-variable with declaration of usage diaplay format of same size and then use reference modification on ws-variable.
Hope this helps you.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Aug 12, 2008 11:42 am    Post subject:
Reply with quote

move it to an S9(6) comp field.

the reference modification will not work because you need to move 3.5 bytes.

reference modification will work for any datatype. whether your results are correct or not depends upon the definitions and what you are trying to do.
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Tue Aug 12, 2008 12:05 pm    Post subject:
Reply with quote

Dick,
I tried running reference modification on usage comp and comp-3 variableb but it;s giving me error compile time error.
here is the error
Code:

IGYPS2214-S   REFERENCE-MODIFIED DATA ITEM "D" WAS NOT DEFINED
WITH "USAGE DISPLAY", "USAGE DISPLAY-1"  OR "USAGE NATIONAL".
THE STATEMENT WAS DISCARDED.


maybe this had to do something with compiler options but as of now
i am on the side that we can use reference modification on usage display variables only.
Please correct me if I am wrong.

Thanks,
Santosh.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Aug 12, 2008 12:26 pm    Post subject:
Reply with quote

data-name-1
Must reference a data item whose usage is DISPLAY, DISPLAY-1, or NATIONAL.
Data-name-1 can be qualified or subscripted. Data-name-1 cannot be a windowed date field.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Aug 12, 2008 12:35 pm    Post subject:
Reply with quote

Santosh,

Sorry, you are right.

I normally ref-mod on a group or redefined reference thus never encounter the compiler error. (or I did once and now automatically redefine fields that I will ref-mod).
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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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