GROUP BY and ORDER BY for IMS DB?
GROUP BY and ORDER BY for IMS DB?
Hi,
Do we have something similar in IMS like DB2's GROUP BY and ORDER BY for IMS DB?
Do we have something similar in IMS like DB2's GROUP BY and ORDER BY for IMS DB?
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: GROUP BY and ORDER BY for IMS DB?
nicc is correct. GROUP BY and ORDER BY works on columns and rows while there are no column and rows in IMS. You might use GU, GN but none can be termed as equivalent of these.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: GROUP BY and ORDER BY for IMS DB?
Then if I have to something which needs to sort the result on a given value how will I do it in IMS commands?
Re: GROUP BY and ORDER BY for IMS DB?
You cnnot becuse there is no IMS command to do such a thing. You have to either pass the data to the next step in the job to sort it or invoke sort from your program or write your own sort routine within your program.
An alternative, if your= have DB2 available to you, is to load the data into a temporary DB2 table as you extract it from the IMS database and then use SQL facilities to read the data back from the DB2 table.
An alternative, if your= have DB2 available to you, is to load the data into a temporary DB2 table as you extract it from the IMS database and then use SQL facilities to read the data back from the DB2 table.
Regards
Nic
Nic
Re: GROUP BY and ORDER BY for IMS DB?
Thanks nicc.
I shall prefer using my own sort routine as getting values from IMS and loading to DB2 would be very expensive than the work required. Thanks for your valuable inputs.
I shall prefer using my own sort routine as getting values from IMS and loading to DB2 would be very expensive than the work required. Thanks for your valuable inputs.
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: GROUP BY and ORDER BY for IMS DB?
IMS stores the data in segments. The smallest unit which you can get from the IMS database is a segment. Segments have fields, defined for your system. If you want to perform some operation on the field, the only option you are left with is to play with fields... in other words, and as far this thread is concerned, you'll have to write your own sort routine.
An after thought: There is anEXEC DLI interface available for IMS, I have not checked the details but it should also work on the segment level but it might worth checking if it can allow you to have something similar like EXEC SQL ... ORDER BY; but it's highly unlikely.
An after thought: There is anEXEC DLI interface available for IMS, I have not checked the details but it should also work on the segment level but it might worth checking if it can allow you to have something similar like EXEC SQL ... ORDER BY; but it's highly unlikely.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: GROUP BY and ORDER BY for IMS DB?
Thanks Anuj. I could find an equivalent of ORDER BY.Anuj Dhawan wrote:IMS stores the data in segments. The smallest unit which you can get from the IMS database is a segment. Segments have fields, defined for your system. If you want to perform some operation on the field, the only option you are left with is to play with fields... in other words, and as far this thread is concerned, you'll have to write your own sort routine.
An after thought: There is anEXEC DLI interface available for IMS, I have not checked the details but it should also work on the segment level but it might worth checking if it can allow you to have something similar like EXEC SQL ... ORDER BY; but it's highly unlikely.
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: GROUP BY and ORDER BY for IMS DB?
That's great!. Can you please share a link to the reference you might have?RaOne wrote:Thanks Anuj. I could find an equivalent of ORDER BY.Anuj Dhawan wrote:IMS stores the data in segments. The smallest unit which you can get from the IMS database is a segment. Segments have fields, defined for your system. If you want to perform some operation on the field, the only option you are left with is to play with fields... in other words, and as far this thread is concerned, you'll have to write your own sort routine.
An after thought: There is anEXEC DLI interface available for IMS, I have not checked the details but it should also work on the segment level but it might worth checking if it can allow you to have something similar like EXEC SQL ... ORDER BY; but it's highly unlikely.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: GROUP BY and ORDER BY for IMS DB?
There is a mistake, I wanted to say NOT. I could NOT find an equivalent of ORDER BY.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute