Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
ENDING AT/THRU with superdescriptor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Wed Nov 11, 2009 10:22 pm    Post subject: ENDING AT/THRU with superdescriptor
Reply with quote

Hi,

This question comes from an interviewer.

Why ENDING AT/THRU can not be used with superdescriptor?

Can somebody help me in answering this question?
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 11, 2009 11:36 pm    Post subject:
Reply with quote

As far as I know, there's no such limitation. May be you meant hyperdescriptors?

O.
Back to top
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Thu Nov 12, 2009 9:04 pm    Post subject:
Reply with quote

Yes. I agree to your point. Otherwise usually we use the ENDING A/THRU with the superdescriptors only.

This makes me to think.

Why such restrictions for hyperdescriptors? I did not work on this descriptor any time.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Sat Nov 14, 2009 2:48 am    Post subject:
Reply with quote

That's easy: Hyperdescriptor is used to generate descriptor values based on a user-supplied algorithm.

Since the ENDING clause is handled by ADABAS, and since ADABAS can't tell the next value of a user-defined sequence, hence you can't use it for hyperdescriptors.

O.
Back to top
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Sat Nov 14, 2009 12:52 pm    Post subject:
Reply with quote

Thats cool. Good to know about it. Thank you. icon_smile.gif
Back to top
View user's profile Send private message
Steve Robinson

New User


Joined: 14 Nov 2009
Posts: 12
Location: U.S.

PostPosted: Sat Nov 14, 2009 11:35 pm    Post subject:
Reply with quote

A correction to earlier post.

Adabas does not deal with ENDING AT clauses; Natural does.

Adabas does deal with Hyper Descriptors.

So, since Natural does not have access to Hyper Descriptors, it cannot use same in an ENDING AT clause.

steve
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Wed Dec 09, 2009 9:56 am    Post subject:
Reply with quote

Since no one challenged the responses, it looks like you all failed the interview! icon_smile.gif Well, this particular question, anyway. This may be due in part to the interviewer being misquoted - see below.

First, as to hyperdescriptors, their values may be generated in a non-Natural way (a user exit coded in Assembler), but they are treated by Natural just like a superdescriptor, and can be used anywhere a super is used.

The interviewer's question applies not only to superdescriptors, but also to subdescriptors and hyperdescriptors. It probably was phrased, "When can THRU not be used with a superdescriptor?", rather than why.

Here's a working example of FROM/THRU, using subdescriptor DEPARTMENT in the EMPLOYEES demo file.
Code:
DEFINE DATA LOCAL
1 EMP VIEW EMPLOYEES
  2 PERSONNEL-ID
  2 DEPT
  2 DEPARTMENT     /* For use by THRU
END-DEFINE
R.
READ EMP BY DEPARTMENT FROM 'ADMA'
                       THRU 'ADMA'
  DISPLAY DEPT (AL=4)
          PERSONNEL-ID
*   UPDATE (R.)
END-READ
END

For the THRU clause (I find the synonym ENDING AT too wordy), Natural needs memory locations in which to place the "retrieved" descriptor value, so that a comparison can be made to the value provided (THRU 'ADMA'). In this example, it means that the subdescriptor, DEPARTMENT, must be included in the view.

What happens when the UPDATE statement is reinstated? Adabas will try to update each field in the view, but Natural knows that the subdescriptor does not actually exist as a field in the EMPLOYEES file, so he issues a NAT0633 at compile-time.
Quote:
NAT0633 Invalid use of view which contains super-/subdescriptor.


To answer the interviewer's question
Quote:
You cannot code THRU with a sub/super/hyper-descriptor in an update READ loop.


To keep the UPDATE, the corrective action is to remove the descriptor from the view. For Natural 3, you replace the THRU with an IF ... ESCAPE BOTTOM statement block to test for the end of range. For Natural 4, you replace the THRU with TO, which does not require the descriptor definition in the view because Adabas tests for the end of range.
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 -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Dataset name ending with YYYY-MM-DD Suresh Shankarakrishnan DFSORT/ICETOOL 5 Wed Oct 17, 2012 1:23 am
No new posts STARTING FROM/ENDING AT vs STARTING F... monasu1998 Java & MQSeries 4 Tue Jul 28, 2009 11:04 pm
No new posts Old story ...New ending Escapa General Talk & Fun Stuff 0 Fri Oct 31, 2008 12:10 pm
No new posts VSAM ERROR job ending SOCB sophia ABENDS & Debugging 2 Thu Oct 02, 2008 3:47 pm
No new posts Null Suppressed fields in a superdesc... monasu1998 Java & MQSeries 1 Fri Aug 01, 2008 9:39 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us