Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to i declare a numeric length 20 9(18)v99??
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: 685
Location: Earth

PostPosted: Wed Sep 26, 2007 1:20 pm    Post subject:
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    Post subject: Reply to: How to i declare a numeric length 20 9(18)v99??
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: 685
Location: Earth

PostPosted: Wed Sep 26, 2007 4:04 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 4:11 pm    Post subject:
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    Post subject: Reply to: How to i declare a numeric length 20 9(18)v99??
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    Post subject: Reply to: How to i declare a numeric length 20 9(18)v99??
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: 2150
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 4:27 pm    Post subject:
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    Post subject: Reply to: How to i declare a numeric length 20 9(18)v99??
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: 1439
Location: Bangalore,India

PostPosted: Wed Sep 26, 2007 4:33 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 4:34 pm    Post subject:
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    Post subject: Reply to: How to i declare a numeric length 20 9(18)v99??
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

Site Director


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

PostPosted: Wed Sep 26, 2007 7:46 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: How to i declare a numeric length 20 9(18)v99??
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: 3158
Location: Tucson AZ

PostPosted: Thu Sep 27, 2007 1:03 pm    Post subject:
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

Site Director


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

PostPosted: Thu Sep 27, 2007 11:46 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us