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
 

 

refering an element in the record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
siddesh

New User


Joined: 13 Mar 2006
Posts: 1

PostPosted: Tue Sep 19, 2006 6:56 pm    Post subject: refering an element in the record
Reply with quote

Hi,

I have a record like below.

01 invoice
02 standard
04 count pic s99 comp-3
02 detail occurs 1 to 17 times depending on count
04 detail1
06 REFERENCE pic x(6)

I want to refer REFERENCE in my program.

Can u please help how to refer the same...

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

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Sep 19, 2006 7:28 pm    Post subject:
Reply with quote

I think You can use
REFERENCE OF detail1 OF detail(ws-ctr)

Here ws-ctr is used for subscript.
Back to top
View user's profile Send private message
arunswap

New User


Joined: 23 Mar 2006
Posts: 13

PostPosted: Tue Sep 19, 2006 7:51 pm    Post subject: cobol
Reply with quote

I have a variable with picture clause of X(4).
I want it to be moved to a host variable with picture clause of pic s9(9) comp.

is it possible....
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Sep 19, 2006 10:14 pm    Post subject: Re: refering an element in the record
Reply with quote

Arun,

Refer as REFERENCE(SUBSCRIPT)

Dave
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Sep 20, 2006 7:23 am    Post subject:
Reply with quote

Hi Arun,

You should start a new topic for your ques. It's easy, just scroll up to the top of this page and click on "New Topic". You'll get a screen similar to this one. Just fill in the Subject window... something like "moving a variable to a host variable". Then pose your ques in the big box.
Back to top
View user's profile Send private message
rocksolid

New User


Joined: 29 Aug 2006
Posts: 21
Location: India

PostPosted: Thu Sep 28, 2006 6:00 pm    Post subject:
Reply with quote

Hi Guptae,

If it (REFERENCE) IS the unique data name in the program, you can simply refer like REFERENCE OF (WS-CTR).

Otherwise, we need to refer as you said.

Thank U,
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Sep 29, 2006 9:19 am    Post subject:
Reply with quote

Hi Rocksolid,

In this case What r u saying is right but better if use qualifier bcoz if latter point some body amend the code & use a variable with Reference then.
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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


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