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

Author Message
Pandian

New User

Joined: 22 Jun 2004
Posts: 1
Location: Chennai

 Posted: Wed Jun 23, 2004 5:22 pm    Post subject: Can we move a Alphanumeric to comp, comp-1 Hai Friends, Can we move a numeric or aplanumeric or alphabetic variables to a comp, comp-1 or comp-2 variables? If it so what happened to the pic clause of the sending and receving variable? Also can you pls provide me some examples for the various possible conditions of move statements? Thanks in advance

priya

Moderator

Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

 Posted: Sat Jun 26, 2004 8:08 am    Post subject: Re You can move numeric to comp But alphanumeric & alphabetic is not possible Allowed Move N / NE to AN / ANE AN / ANE to A and wise versa, except ANE to NE Note: N - Numeric NE - Numeric Edited AN - Alphanumeric ANE - AN Edited A - alphanumeric
DIVAKAR

New User

Joined: 26 Jun 2004
Posts: 3
Location: Trichy

 Posted: Sat Jun 26, 2004 8:52 am    Post subject: hi pandian we can move numeric value to comp,comp1 comp2 fileds suppose 77 I pic 9999. 77 J PIC S9(4) COMP. MOVE I TO J. DATA : I - 1234 J - 234 comp1 ------- 77 I pic 9999. 77 J COMP1. MOVE I TO J. DATA : I - 1234 J - .12340000E+4 comp2 ------- 77 I pic 9999. 77 J COMP1. MOVE I TO J. DATA : I - 1234 J - .1234000000000000E+4 Dhivakar - Trichy
shammiullah

New User

Joined: 13 Jun 2005
Posts: 24

 Posted: Tue Nov 15, 2005 11:41 pm    Post subject: 77 I pic 9999. 77 J PIC S9(4) COMP. MOVE I TO J. DATA : I - 1234 J - 234 ................here is it for sure that if i display j it'll show 234.comp will internally take 2 bytes for j.so,where the sign will b stored.
mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Wed Nov 16, 2005 11:32 pm    Post subject: Hi Sham, J will contain 04D2, which is the binary equivilant of 1234. The sign is 0 (pos) in the hi ord bit of the hi ord byte. If -1234 were moved to J, it would contain FB2E. The sign is 1 (neg) in the hi ord bit of the hi ord byte.
mbr_raja

New User

Joined: 15 Nov 2004
Posts: 26
Location: Chennai, India

 Posted: Wed Nov 16, 2005 11:55 pm    Post subject: RE:Can we move a numeric or aplanumeric to comp, comp-1 You can move numeric or alphanumeric to comp, comp-1 etc, but the difference is as follows: Move numberic to comp or comp-1 working fine Move alphanumeric to comp or comp-1 SOC4 error Since Comp and Comp-1 tries to stores the data in Hex format in the memory, but you cannot process or dispaly, If you try this, i leads SOC4 error. 01 c pic 99 comp. Ex: move 123 to c move "ABCD" to C
shammiullah

New User

Joined: 13 Jun 2005
Posts: 24

 Posted: Thu Nov 17, 2005 12:14 am    Post subject: Re: Can we move a numeric or aplanumeric to comp, comp-1 hI MMWIFE, WAT U'VE SAID IS RIGHT.....PREVIOUSLY SOME ONE HAS WRITTEN THAT I & J WILL CONTAIN 1234 AND 234. BUT AS U'VE SAID IT'LL B LIKE I-----1234 J-----123D IF ITZ DELARED AS S9(4)COMP. IT'LL BE I------1234 J------1234 IF ITZ DELARED AS 9(4)COMP. CORRECT ME IF I'M WRONG...........THANK U.
mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Thu Nov 17, 2005 1:38 am    Post subject: I'm assuming both I and J are signed. If you add another field - K with a PIC S9(4) USAGE DISPLAY and move J to K, then: The contents of K will be 123D if the 1234 is positive. The contents of K will be 123M if the 1234 is negative. If K is defined as PIC 9(4) USAGE DISPLAY, then K will contain 1234 in both cases.
 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 COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

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