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
 

 

Could you give me a sample which declare a array and how to

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
hazard84414
Warnings : 1

New User


Joined: 20 May 2006
Posts: 4

PostPosted: Sun May 21, 2006 7:38 pm    Post subject: Could you give me a sample which declare a array and how to
Reply with quote

Hi, everyone:
Could you give me a sample which declare a array and how to use it ?
Back to top
View user's profile Send private message

banu

New User


Joined: 09 Aug 2005
Posts: 8
Location: Chennai

PostPosted: Tue May 23, 2006 3:41 pm    Post subject: Re: Could you give me a sample which declare a array and how
Reply with quote

DCL
NAME(3) CHAR(1) INIT(' ');

/* NAME -> Array */

Get List (Name); /* Get the Input */

Do I = 1 to Hbound(Name,1); /* Hbound -> Highest limit of the array */

Put list (Name(i)); /* Display the Output */

End;



-- I Hope this is what you required...
Back to top
View user's profile Send private message
banu

New User


Joined: 09 Aug 2005
Posts: 8
Location: Chennai

PostPosted: Tue May 23, 2006 3:52 pm    Post subject: Re: Could you give me a sample which declare a array and how
Reply with quote

In my previous example, I forgot to give declaration for the variable 'I'.
Back to top
View user's profile Send private message
chan2004

New User


Joined: 28 Mar 2007
Posts: 16
Location: India

PostPosted: Thu Feb 25, 2010 9:01 pm    Post subject:
Reply with quote

How do you get the hbound of an array of structures?

I am getting IBM1641I error.

Thanks,
C
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 Feb 25, 2010 9:50 pm    Post subject:
Reply with quote

Hello,

Suggest you provide more complete info (i.e. your code so far). . .

Also, you have replied to a topic that has been inactive for almost 4 years. . .
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Mon May 10, 2010 2:16 pm    Post subject:
Reply with quote

Well.. Could anyone just explain with a simple example on homw hbound work? and dimension too.. please...
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Mon May 10, 2010 5:16 pm    Post subject:
Reply with quote

donateeye wrote:
Well.. Could anyone just explain with a simple example on homw hbound work? and dimension too.. please...


RTFM! Enter HBOUND in the text-box and press F3 repeatedly (aka 7 times) until you see what you need!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Mon May 10, 2010 5:36 pm    Post subject: Reply to: Could you give me a sample which declare a array a
Reply with quote

Quote:
DIMENSION returns a FIXED BINARY(31,0) value specifying the current extent of dimension y of x.

Quote:
LBOUND returns a FIXED BINARY (31,0) value specifying the current lower bound of dimension y of x.

Quote:
HBOUND returns a FIXED BINARY(31,0) value specifying the current upper bound of dimension y of x.

everything seems pretty clear to me...
what is that You do not understand ??

c /extent/cardinality
c /dimension/index
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Tue May 11, 2010 3:16 pm    Post subject:
Reply with quote

SO, if I have an array a(100)

then DIM(a) is 100,
LBOUND(a) is 0
and HBOUND(a) is 100

Is that right...?
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Tue May 11, 2010 3:29 pm    Post subject:
Reply with quote

donateeye wrote:
SO, if I have an array a(100)

then DIM(a) is 100,
LBOUND(a) is 0
and HBOUND(a) is 100

Is that right...?


No, LBOUND is 1.

DCL A(-3:3, 77:99)

DIM(A, 1) = 7
DIM(A, 2) = 23
LBOUND(A, 1) = -3
HBOUND(A, 1) = 3
LBOUND(A, 2) = 77
HBOUND(A, 2) = 99
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Tue May 11, 2010 3:31 pm    Post subject:
Reply with quote

Thats the one I am looking for... Prino... you are a star
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts Can I use sort to select sample recor... Steve Ironmonger DFSORT/ICETOOL 3 Tue Nov 10, 2015 10:02 pm
No new posts COBOL Program to Read Array data raj4neo COBOL Programming 8 Sat Aug 15, 2015 12:28 am
No new posts Checking for High-Values in an array amitc23 COBOL Programming 10 Wed Aug 05, 2015 4:09 pm


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