Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
suresh.gb

New User

Joined: 06 Dec 2006
Posts: 1
Location: Bangalore

 Posted: Thu Dec 21, 2006 12:36 pm    Post subject: Move 9(4) to S9(4) 05 A Pic S9(4) comp 05 B Pic X(4) Move " 3000" to B. Move B To A. What is the value of A of executing the above statement.

William Thompson

Global Moderator

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

 Posted: Thu Dec 21, 2006 3:32 pm    Post subject: If the move worked (a redefine would be easier in this case) a would equal 4092653808 which is the decimal value of 11110011111100001111000011110000 which is the binary value of F3F0F0F0 which is the hec value of 3000 which is the character value of 4092653808.
DavidatK

Active Member

Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

Posted: Thu Dec 21, 2006 9:34 pm    Post subject: Re: Move 9(4) to S9(4)

Hello suresh.gb,

 Quote: 05 A Pic S9(4) comp 05 B Pic X(4) Move " 3000" to B. Move B To A. What is the value of A of executing the above statement.

The compiler is probably to smart for its own good. It will make the assumption that you are moving numeric data and convert the char string ?3000? to binary on the move.

The Field ?A? will have a value of 3000, hex value x?0BB8?.
dick scherrer

Site Director

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

Posted: Fri Dec 22, 2006 1:23 am    Post subject:

Hello,

This code
 Code: 01  SOMESTUFF.                    05 A PIC S9(4) COMP.          05 B PIC X(4).              MOVE "3000" TO B.              MOVE B TO A.                  DISPLAY 'A=' A.                DISPLAY 'B=' B.                DISPLAY ' '.

returns
 Code: A=3000 B=3000

Interestingly, this code
 Code: MOVE "00AB" TO B.          MOVE B TO A.                DISPLAY 'A=' A.            DISPLAY 'B=' B.            DISPLAY ' '.

returns
 Code: A=0012  B=00AB

while this code
 Code: MOVE "00@\" TO B.      MOVE B TO A.            DISPLAY 'A=' A.        DISPLAY 'B=' B.        DISPLAY ' '.

returns an 0C7.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics RMM Cannot move a volume from SHELF l... tspr52 IBM Tools 0 Thu Mar 01, 2018 3:48 pm how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us