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

How to i declare a numeric length 20 9(18)v99??


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Wed Sep 26, 2007 12:38 pm
Reply with quote

Can u Explain with an Example how to override the Compiler options,
to work numeric items of length greater than 18?
I tried to put
CBL arith(extend) before Identifcation section.
but it gives compiler error of maxxcc=8 , saying the statement is found but discrded..
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Sep 26, 2007 1:20 pm
Reply with quote

You can give ARITH (EXTEND) in your compiler JCL. Compiler options are passed to IGYCRCTL (Compiler program) just like we pass parameters to any program through JCL.
Ex:
Code:
EXEC PGM=IGYCRCTL,PARM='ARITH(EXTEND)'
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Wed Sep 26, 2007 3:48 pm
Reply with quote

Hi

For Compiler option
//COBOL EXEC PGM=IGYCRCTL,PARM='ARITH(EXTEND)'
is not working for arithmatic operation.
I am getting
'IGYOS4003-E Invalid option "ARITH(EXTEND)" was found and discarded. '
Can you please suggest how i need to Pass ARITH to compiler.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Sep 26, 2007 4:04 pm
Reply with quote

TRY THIS-
Code:
//STEPS1   EXEC PGM=IGYCRCTL,
//         PARM=(ARITH(EXTEND))

or
Code:
//STEPS1   EXEC PGM=IGYCRCTL,
//         PARM='ARITH(EXTEND)'

or
Code:
EXEC PGM=IGYCRCTL,PARM='ARITH(EXTEND)'


All should work correctly. Can't even guess where you are making mistake in such a simple thing. icon_confused.gif
Please post the whole compile step so that we can offer suggestions.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Sep 26, 2007 4:11 pm
Reply with quote

What COBOL are you using?
Post the compile listing page header, that should have the version information....
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Wed Sep 26, 2007 4:16 pm
Reply with quote

THis is the test Jcl iam using...
Pls pot ur Jcl (entire jcl) if this is wrong, so that i can use that...


//xxxxxxx JOB NOTIFY=&SYSUID
//MYPROC PROC LNGPRFX='IGY.V2R1M0',SYSLBLK=3200,
// LIBPRFX='CEE',
// PGMLIB='&&GOSET',GOPGM=GO
//COBOL EXEC PGM=IGYCRCTL,PARM='ARITH(EXTEND)',REGION=2048K
//STEPLIB DD DSNAME=&LNGPRFX..SIGYCOMP,
//STEPLIB DD DSNAME=&LNGPRFX..SIGYCOMP,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSNAME=&&LOADSET,UNIT=SYSDA,
// DISP=(MOD,PASS),SPACE=(TRK,(3,3)),
// DCB=(BLKSIZE=&SYSLBLK)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT5 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT6 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//LKED EXEC PGM=HEWL,COND=(8,LT,COBOL),REGION=1024K
//SYSLIB DD DSNAME=&LIBPRFX..SCEELKED,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSNAME=&&LOADSET,DISP=(OLD,DELETE)
// DD DDNAME=SYSIN
// DD DDNAME=SYSIN
//SYSLMOD DD DSNAME=&PGMLIB(&GOPGM),
// SPACE=(TRK,(10,10,1)),
// UNIT=SYSDA,DISP=(MOD,PASS)
//SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10))
//MYPROC PEND
//STEP1 EXEC MYPROC
//COBOL.SYSIN DD DSN=xxxx.xxx.xxx(xxxx),DISP=SHR
//LKED.SYSLMOD DD DSN=xxx.xxx.xxx(xxx),DISP=SHR
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Wed Sep 26, 2007 4:19 pm
Reply with quote

This is the version of cobol iam using, which i get in compile listing


PP 5648-A25 IBM COBOL for OS/390 & VM 2.1.1
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Sep 26, 2007 4:27 pm
Reply with quote

That explains that, 18 is the max number of digits allowed, no ARITH(EXTEND) allowed.....
You are going to have to deal with the problem some other way.....
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Wed Sep 26, 2007 4:30 pm
Reply with quote

Have anyone encountered a similar problem??
What do you suggest me to do , to solve this problem...
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Sep 26, 2007 4:33 pm
Reply with quote

Vignrsh,

Use group variable.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Sep 26, 2007 4:34 pm
Reply with quote

What exactally is the problem?
What sort of operation do you need to apply to this number?
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Wed Sep 26, 2007 5:32 pm
Reply with quote

I have a Amount which is 20 numerals in length...
I am multiplying this with another Amount Field and Storing in the same field.
Thats Y i need to perform this operation. If I use group variable and then multiply/add , i am not sure the resultant value would be correct......
Does Anyone have a Suggestion apart from this???
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Sep 26, 2007 7:46 pm
Reply with quote

Hello,

What created this 20-numeral value?

If your compiler doesn't support it, was it built on some other system?

Is it possible that the value will never be that large/long?

What kind of value is stored in the number?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Wed Sep 26, 2007 7:55 pm
Reply with quote

When you multiply a 20 byte number by anything larger then 1 you could end up with a number larger then 20 bytes.
Back to top
View user's profile Send private message
VIGNRSH
Warnings : 1

New User


Joined: 18 Mar 2007
Posts: 44
Location: New Jersey,USA

PostPosted: Thu Sep 27, 2007 10:38 am
Reply with quote

Yes , Thats y iam looking out for a way to store up to 31 digits , with Artih(extend)...
I have a Amount which is 20 numerals in length.
It does sometimes , get filled because , it is Total of Revenue /Expenses
Of an Company! ! So there is every need to accomodate that field with length greater than 18, that is usually supported...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Sep 27, 2007 1:03 pm
Reply with quote

With the level of COBOL you are working with, it is not possible.....
"it is Total of Revenue /Expenses Of an Company".... How many thousands of trillions of whatever unit of currency?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Sep 27, 2007 11:46 pm
Reply with quote

Hello,

Quote:
It does sometimes , get filled because , it is Total of Revenue /Expenses Of an Company! ! So there is every need to accomodate that field with length greater than 18, that is usually supported...


Please clarify how this can be true. The combined revenues of WalMart and Exxon-Mobil (the 2 largest companies in the world) is $698,393,000,000 (the sum of $351,139,000,000 and $347,254,000,000). This takes only 12 positions before the decimal. What kind of $ are you processing that takes more than that?

On your system, how is that "usually supported"? Doesn't sound like it could have been. . .

There is something you have not posted or that we are missing. . . icon_confused.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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top