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

refering an element in the record


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Tue Sep 19, 2006 7:28 pm
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
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
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
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
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: 1208
Location: Bangalore,India

PostPosted: Fri Sep 29, 2006 9:19 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top