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
 

 

Can I declare S9(19) in cobol
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 2:57 am    Post subject: Can I declare S9(19) in cobol
Reply with quote

Hi,

Can I declare s9(19) in cobol.

What is the maximum numeric digits allowed.
Whats the alternative to use s9(19).

Thanks
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


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

PostPosted: Tue Jun 10, 2008 3:09 am    Post subject:
Reply with quote

You need to check the manuals for your version of COBOL

For Enterprise COBOL
Quote:
For binary items, the number of digit positions must range from 1 through 18 inclusive. For packed decimal and zoned decimal items the number of digit positions must range from 1 through 18, inclusive, when the ARITH(COMPAT) compiler option is in effect, or from 1 through 31, inclusive, when the ARITH(EXTEND) compiler option is in effect.
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 3:24 am    Post subject:
Reply with quote

How do you declare in the JCL?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Jun 10, 2008 4:38 am    Post subject:
Reply with quote

You don't declare COBOL Pic's in JCL!
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: Tue Jun 10, 2008 5:47 am    Post subject:
Reply with quote

Hello,

Quote:
Whats the alternative to use s9(19).
Please explain the content of (or how you will use) a 19 digit number.

Show a few actual values and how they might "decompose".

For example a number like 70355523236784 could be a phone number consisting of the area code (703), the access/exchange code(555), the specific phone (2323) and the "extension" (6784). Is your number a collection of components?
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 7:04 am    Post subject:
Reply with quote

Craq Giegerich wrote:
You don't declare COBOL Pic's in JCL!


No, I mean how do you declare the ARITH(EXTEND) in JCL?
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 7:17 am    Post subject:
Reply with quote

I'm writing a COBOL program to simulate setup message properties for the latest MQ version 7.

I need a variable of S9(19) in order to create the message handle.

Here is the link of the API call:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzak.doc/fr40230_.htm?resultof=%22%4d%51%43%52%54%4d%48%22%20%22%6d%71%63%72%74%6d%68%22%20
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: Tue Jun 10, 2008 7:54 am    Post subject:
Reply with quote

Hello,

ARITH(EXTEND) is one of the parms that may be supplied to the compiler. It is usually specified as an override in the execute jcl.

When your compile is submitted, there are most likely parameters supplied in the compile PARM. You would need to add ARITH to those parms.

I'd suggest you talk with whoever supports your standard compiler processes and explain the requirement and they should be able to show you how to do this on your system.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Jun 10, 2008 8:03 am    Post subject:
Reply with quote

We put it as the very first line in the COBOL source if we need it. Before any IDENTIFICATION or anything else it acts as a precompiler directive.
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 9:17 am    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

ARITH(EXTEND) is one of the parms that may be supplied to the compiler. It is usually specified as an override in the execute jcl.

When your compile is submitted, there are most likely parameters supplied in the compile PARM. You would need to add ARITH to those parms.

I'd suggest you talk with whoever supports your standard compiler processes and explain the requirement and they should be able to show you how to do this on your system.



Hi, Thanks for your help, however I have still getting the "more than 18 bytes " error after I have added the ARITH(EXTEND). Could it be compiler version problem as I'm using Enterprise COBOL 3.4.1 ?
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: Tue Jun 10, 2008 1:11 pm    Post subject:
Reply with quote

Hello,

Quote:
Could it be compiler version problem as I'm using Enterprise COBOL 3.4.1 ?
That version is current.

Please post your jcl/source where you specified arith(extend) as well as the part of the output that shows the compiler optons in effect for your compilation.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Jun 10, 2008 6:49 pm    Post subject:
Reply with quote

Here is how we do it. It goes as the first line in the COBOL source.
Code:

PROCESS ARITH(EXTEND)                                 
IDENTIFICATION DIVISION.                               
PROGRAM-ID.    MYPROG.                               
AUTHOR.        S STODOLA.                             
INSTALLATION.  MY COMPANY.           
DATE-WRITTEN.  SEPTEMBER 30, 2005.                     
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 7:08 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Quote:
Could it be compiler version problem as I'm using Enterprise COBOL 3.4.1 ?
That version is current.

Please post your jcl/source where you specified arith(extend) as well as the part of the output that shows the compiler optons in effect for your compilation.


Compilation error: IGYDS1505-S: More than 18 digit positions were specified in a "PICTURE" of "S9(18)" was assumed.

The JCL is, you can look at the attachment as well:

//SETPP JOB 30000030000CN,INGM001,CLASS=A,MSGCLASS=Q,
// NOTIFY=INGM001,MSGLEVEL=(0,0),REGION=6M
//********************************************************************
//* *
//* LICENSED MATERIALS - PROPERTY OF IBM *
//* *
//* 5645-001 *
//* (C) COPYRIGHT IBM CORP. 1988, 1997 ALL RIGHTS RESERVED *
//* *
//* US GOVERNMENT USERS RESTRICTED RIGHTS - USE, *
//* DUPLICATION OR DISCLOSURE RESTRICTED BY GSA ADP *
//* SCHEDULE CONTRACT WITH IBM CORP *
//* *
//EDCCPL EXEC IGYWCL,PARM.COBOL='OBJECT,LIB,APOST,LIST',
// PARM.LKED='AMODE=24,RMODE=24'
//COBOL.SYSLIB DD DSN=SYS1.WMQ700.SCSQCOBC,DISP=SHR
//SYSIN DD DSN=INGM001.MQ70.CBLS(SETPROP),DISP=SHR
//LKED.CSQSTUB DD DSN=SYS1.WMQ700.SCSQLOAD,DISP=SHR
//LKED.BSQSTUB DD DSN=INGM001.COBOL.LOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE CSQSTUB(CSQBSTUB)
/*
//LKED.SYSLMOD DD DSN=INGM001.COBOL.LOAD(SETPPEXE),DISP=SHR

Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 7:15 pm    Post subject:
Reply with quote

I have tried to put the ARITH(EXTEND) on the PARM.COBOL= in JCL and also PROCESS ARITH(EXTEND) or CBL ARITH(EXTEND) before the IDENTIFICATION DIVISION, however it is still failed.
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: Tue Jun 10, 2008 7:26 pm    Post subject:
Reply with quote

Hello,

You have posted nothing that shows where you used the extend icon_confused.gif

Have you tried the method Steve posted? In the code or in the jcl will work so you should check with your organization on which method is proper for your system. Either should get you thru an initial test.

So far, we've seen nothing that would tell the compiler that large numbers were valid.
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 7:39 pm    Post subject:
Reply with quote

I have tried with this:

//EDCCPL EXEC IGYWCL,PARM.COBOL='OBJECT,LIB,APOST,LIST,
// ARITH(EXTEND)',


as well as this:

CBL ARITH(EXTEND)
IDENTIFICATION DIVISION.


but still no success.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Jun 10, 2008 7:46 pm    Post subject: Reply to: Can I declare S9(19) in cobol
Reply with quote

Ok so now we have zillions of confirmation that it does not work,
it will keep on not working until You post an excerpt of the sysout
showing the active options for Your compile step.

But I would say that this is more an issue for Your support rather than a forum

COBOL is not my friend, but thinking in parallel with PL/I

when the defaults options are being setup at installation time
the options are divided in two section
the overridable ones ( the ones that can be changed by parm or process )
the not-overridable ( the ones that cannot be changed )
check with Your support if this is the case
giving as evidence what has been requested a few times,
and You still did not provide
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Jun 10, 2008 8:07 pm    Post subject:
Reply with quote

The compiler is installed and set up with default compiler options. While installing the compiler, the system programmers for a site can fix compiler option settings to, for example, ensure better performance or maintain certain standards. You cannot override any compiler options that your site has set as fixed. For options that are not fixed, you can override the default settings by specifying compiler options in either of these ways:


The first page of your compile listing should look something like this
Code:
PP 5655-G53 IBM Enterprise COBOL for z/OS  3.4.1             Invocation parameters:                                                   
AR(E),MAP,OPT,NOSEQ,XREF,LIST,SSR,CICS,TRUNC(BIN),,NOADV,LIB,RENT,NODYNAM
PROCESS (CBL) Statements:                                                 
CBL NORW LINECOUNT(57)                                                   
CBL SQL("APOSTSQL STDSQL(NO)") NORW LINECOUNT(57)                         
Compiler options in effect:       
    NOADATA                         
    NOADV                         


You can look at this and see if 'ARITH(EXTEND)' is being used or not. In this listing AR(E) is being passed as a compile time option for ARITH(EXTEND).
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 9:14 pm    Post subject:
Reply with quote

Craq Giegerich wrote:
The compiler is installed and set up with default compiler options. While installing the compiler, the system programmers for a site can fix compiler option settings to, for example, ensure better performance or maintain certain standards. You cannot override any compiler options that your site has set as fixed. For options that are not fixed, you can override the default settings by specifying compiler options in either of these ways:


The first page of your compile listing should look something like this
Code:
PP 5655-G53 IBM Enterprise COBOL for z/OS  3.4.1             Invocation parameters:                                                   
AR(E),MAP,OPT,NOSEQ,XREF,LIST,SSR,CICS,TRUNC(BIN),,NOADV,LIB,RENT,NODYNAM
PROCESS (CBL) Statements:                                                 
CBL NORW LINECOUNT(57)                                                   
CBL SQL("APOSTSQL STDSQL(NO)") NORW LINECOUNT(57)                         
Compiler options in effect:       
    NOADATA                         
    NOADV                         


You can look at this and see if 'ARITH(EXTEND)' is being used or not. In this listing AR(E) is being passed as a compile time option for ARITH(EXTEND).


Attached herewith the listings, the listing1 (top) is showing ARITH(EXTEND) is in effect but on the listing2 (bottom) is giving error.
Back to top
View user's profile Send private message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 9:20 pm    Post subject:
Reply with quote

Hi Craq, I'm getting the AR(E) on the listing, could it be the option cannot be overridable?
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


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