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

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


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Thu Feb 25, 2010 9:50 pm
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
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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon May 10, 2010 5:16 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 10, 2010 5:36 pm
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
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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue May 11, 2010 3:29 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
No new posts Can you give me examples of programs ... CLIST & REXX 22
Search our Forums:

Back to Top