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

refrence modifier problem


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Fri Jan 27, 2006 7:37 pm
Reply with quote

could u please suggest me whether the syntax is correct or not

SUB(X-PACS-SUB)(3:ctra)

where (3:ctra) is a refrence modifier and ctra is a counter variable.

thanks
Dipanshu
Back to top
View user's profile Send private message
DavidatK

Active Member


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

PostPosted: Fri Jan 27, 2006 11:14 pm
Reply with quote

dipanshu,

Yes, your syntax is correct. Valuable(subscript)(reference modifier)

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

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Fri Jan 27, 2006 11:31 pm
Reply with quote

Hi,

I dont think we can specify any other thing apart from starting position and length in reference modification.

Syntax is

Var(start pos:length)

Eg: WS_DATE(1:2)

And for subscript you can use this way.

SUB(element)(starting position:length)


Correct me if I am wrong......

Thank you,
Brahma
Back to top
View user's profile Send private message
DavidatK

Active Member


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

PostPosted: Fri Jan 27, 2006 11:56 pm
Reply with quote

brahmanandareddy,

Is your concern having a variable as starting-position or length? This can be done. If this is not you're concern, please clairify.

Thanks,

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jan 28, 2006 5:03 am
Reply with quote

Hi Dipanshu,

It might be a good idea to tell us what each of the elements are. For e.g.:

SUB is a pic 9(12) variable containing blah-blah..
X-PACS-SUB is a subscript defined as blah-blah...
3 is the 3rd position of ?
ctra is a variable defined as pic 9(2) containing the length of blah-blah...

You might have them reversed and we can't tell unless you give this info.
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Sat Jan 28, 2006 2:22 pm
Reply with quote

dipanshu wrote:
could u please suggest me whether the syntax is correct or not

SUB(X-PACS-SUB)(3:ctra)

where (3:ctra) is a refrence modifier and ctra is a counter variable.

thanks
Dipanshu



hi Dipanshu,

I feel what Brahma said is right. i tried once with specifying the identifier instead of saying the value for it. I got it correct syntactically, but in run time i didn't get the expected result.

can anyone suggest the possible reasons for it. That would add more info.


corrections and suggestions welcomed...

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jan 28, 2006 10:34 pm
Reply with quote

You can use variable instead of literals in ref/mod. You just have to make sure they contain the values you think they contain.

The reason I requested the info is that I'm suspecious of a data variable named "SUB".
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top