1) Can we move a Comp-3 variable in to a Comp Variable? If Yes how?
2) Can we pass a Comp-3 variable in to a Alphanumeric variable using reference modification? If no than is there any way i can do so?
Comp-3 variables to Comp variables.
Moderators: dbzTHEdinosauer, Moderator Group
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Hi Anuj,
I tried to Move a Comp-3 variable in to Comp variable or vice versa and was getting SOC-7 Abend. I am not sure what data type should i give for them. For ex i was trying to move A to B where A is defined as PIC S9(18 ) COMP-3 and B defined as S9(10) COMP.
For the second point i tried to move a COMP-3 data in to a Alphanumeric variable but was facing a data truncation error. For ex:
01 A PIC X(300).
01 B PIC S9(18 ) COMP-3.
MOVE 123456789012345678 TO B.
MOVE B TO A(18:10).
The resultant data which got moved to A is 1 2 3 4 5 6 7 8 9
I tried to Move a Comp-3 variable in to Comp variable or vice versa and was getting SOC-7 Abend. I am not sure what data type should i give for them. For ex i was trying to move A to B where A is defined as PIC S9(18 ) COMP-3 and B defined as S9(10) COMP.
For the second point i tried to move a COMP-3 data in to a Alphanumeric variable but was facing a data truncation error. For ex:
01 A PIC X(300).
01 B PIC S9(18 ) COMP-3.
MOVE 123456789012345678 TO B.
MOVE B TO A(18:10).
The resultant data which got moved to A is 1 2 3 4 5 6 7 8 9
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
you received a SOC7 because you had non-numberics in your source variable.
that you received a SOC7 had nothing to do with comp to comp-3 and comp-3 to comp,.
that you received a SOC7 had nothing to do with comp to comp-3 and comp-3 to comp,.
you only moved 10 bytes. what do you expect?MOVE B TO A(18:10)
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
For 2nd point... you may try below.
Code: Select all
MOVE B to temp-alpha-numeric-var.
MOVE temp-alpha-numeric-var(18:10) TO A(18:10).
Natarajan
Chennai
Chennai
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page