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

Move from comp-3 to comp


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pankajupadhyay
Warnings : 1

New User


Joined: 04 May 2007
Posts: 13
Location: pune

PostPosted: Tue May 22, 2007 7:18 pm
Reply with quote

HI all,
hear i have a confusion plz let me know all about move from different usage clause. Ex--
77 A pic 99999 VALUE 12345

77 B pic s99999 comp-3

77 C pic s99999 comp

77 D pic xxxxx

77 E pic aaaaa

MOVE A TO B
MOVE A TO C
MOVE A TO D
MOVE B TO D
MOVE B TO A
MOVE B TO C
MOVE B TO D
MOVE D TO E
MOVE E TO D
MOVE D TO A


AND HOW CAN DISPLAY THE VALUE OF COMP AND COMP-3
CAN I USE DISPLAY " VALUE OF COMP IS " COMP-3 ,COMP

PLZ HELP ME BCZ THERE IS NO SYSTEM AVAILABLE TO CHECK OUT ALL FOR INTERVIEW
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Tue May 22, 2007 9:04 pm
Reply with quote

The best thing you can do to prepare is to read up on Elementary moves in the manual.
Back to top
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Fri Jun 01, 2007 8:50 pm
Reply with quote

See pankajupadhyay

COMP-3 is what? Packed decimal ? is this for internal storage?
to save the storage purpose for numeric?

Find the above "THOUGHTS"

Then u will come to know can we able to display the COMP-3.


ANSWER is Certainly NOT NOT NOT NOT

Thank you
Sree
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Jun 01, 2007 9:02 pm
Reply with quote

srebba wrote:
COMP-3 is what? Packed decimal ? is this for internal storage?
to save the storage purpose for numeric?

Find the above "THOUGHTS"
And your point?
Quote:
Then u will come to know can we able to display the COMP-3.

ANSWER is Certainly NOT NOT NOT NOT
Certainly NOT what?
Back to top
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Fri Jun 01, 2007 11:04 pm
Reply with quote

Pls Think abou the display statment...

U can not display COMP-3 field..
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Fri Jun 01, 2007 11:26 pm
Reply with quote

srebba wrote:
Pls Think abou the display statment...

U can not display COMP-3 field..


Please test that statement before you report as a fact! icon_cry.gif
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Sat Jun 02, 2007 1:05 pm
Reply with quote

Quote:
U can not display COMP-3 field



why can't u ?? icon_eek.gif
Back to top
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Sun Jun 03, 2007 12:34 am
Reply with quote

I did and I have given the answer

Without my exp. how could i give the answer.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun Jun 03, 2007 12:58 am
Reply with quote

srebba wrote:
I did and I have given the answer
Yes, you gave an answer, an incorrect one, but an answer never the less....
Quote:
Without my exp. how could i give the answer.
Good point, then without your experience, why did you give an answer?
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: Sun Jun 03, 2007 1:33 am
Reply with quote

Hello,

If you tried this (display comp3-field) and it "would not work" please post your field definition, the procedure division code in question, and the compiler error, run-time abend, or the undesired result you received.

My observation is that very many of us have DISPLAYed comp-3 fields with no problems for a long, long time.

As i mentioned, if you post what you have and what the result was, we can tell you why your attempt has problems.

I will add this - if your comp-3 field was within a group of fields (i.e. a record layout), that will not work as desired because you are not displaying a comp-3 field - that is a pic x(nn) display.
Back to top
View user's profile Send private message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Sun Jun 03, 2007 3:20 am
Reply with quote

You are correct..i tried to run this program with the below updates
Code:

MOVE A TO B                           
DISPLAY ' MOVE A TO B --> ' A ' : ' B 
MOVE A TO C                           
DISPLAY ' MOVE A TO C --> ' A ' : ' C 
MOVE A TO D                           
DISPLAY ' MOVE A TO D --> ' A ' : ' D 
MOVE B TO D                           
DISPLAY ' MOVE B TO D --> ' B ' : ' D 
MOVE B TO A                           
DISPLAY ' MOVE B TO A --> ' B ' : ' A 
MOVE B TO C                           
DISPLAY ' MOVE B TO C --> ' B ' : ' C 
MOVE B TO D                           
DISPLAY ' MOVE B TO D --> ' B ' : ' D 
MOVE D TO E                           
DISPLAY ' MOVE D TO E --> ' D ' : ' E 
MOVE E TO D                           
DISPLAY ' MOVE E TO D --> ' E ' : ' D 
MOVE D TO A                           
DISPLAY ' MOVE D TO A --> ' D ' : ' A 


Values of all the variables were displayed, irrespective of their type.

Output
Code:

MOVE A TO B --> 12345 : 12345
MOVE A TO C --> 12345 : 12345
MOVE A TO D --> 12345 : 12345
MOVE B TO D --> 12345 : 12345
MOVE B TO A --> 12345 : 12345
MOVE B TO C --> 12345 : 12345
MOVE B TO D --> 12345 : 12345
MOVE D TO E --> 12345 : 12345
MOVE E TO D --> 12345 : 12345
MOVE D TO A --> 12345 : 12345


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: Sun Jun 03, 2007 3:28 am
Reply with quote

Itanium wrote:
You are correct.
Thanks.
Well, thank you back.....
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: Sun Jun 03, 2007 4:10 am
Reply with quote

Hello Itanium,

Thank you for posting your tests and the results.

As you see from some previous replies, you verified what several of us expected would happen.

Hopefully, Sree has learned something new or will post the situation that did not work as desired so we might clarify what happened in that test.
Back to top
View user's profile Send private message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Mon Jun 11, 2007 8:10 pm
Reply with quote

Yes Dudes,

Ur right. i have tested, previosuly I had record layout and i tested. at that time it did not work. now i coded separete field and i tested , it worked.

Thanks for arouse
Sree
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 Jun 11, 2007 8:22 pm
Reply with quote

You're welcome.

Thanks for posting your result icon_smile.gif
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts How to move DB2 Installation HLQ DB2 4
Search our Forums:

Back to Top