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
 

 

How to write a Query in IMS DB....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
PrasadV

New User


Joined: 21 Mar 2004
Posts: 8
Location: Chennai

PostPosted: Sat Mar 27, 2004 5:38 pm    Post subject: How to write a Query in IMS DB....
Reply with quote

Hi Guys,

i have the following segments with the field declarations.

Customer

cno char Primary Key
cname
cdep
cadds
cphone

Dept

ddep Primary Key
ddname

How shall i retrive records for the following query.

List all employees working in 'Sales' department.

Pls. do give the answer(Query) to the problem in IMS DB.

Thanx. in Adv.

V. Prasad.[/b]
Back to top
View user's profile Send private message

G.P.Naidu

New User


Joined: 28 Apr 2004
Posts: 4
Location: delhi

PostPosted: Tue Jun 01, 2004 2:32 pm    Post subject:
Reply with quote

Hi,

HERE I AM GIVING COBOL IMS DB CODE FOR UR REQUIREMENT.

Code:
   1000-PARA.
   CALL  'CBLTDLI' USING GN-FUNCTION
                            CUST-PCB-MASK
                            CUST-IO-AREA
                            UNQUAL-CUST-SSA

   IF CUST-STATUS = 'GB' | CUST-STATUS = 'GE'
      MOVE 'Y' TO END-OF-DATABASE 
      PERFORM 100-END-OF-PARA
   ELSE
       IF CUST-STATUS = ' '
           PERFORM 101-WRITE-PARA
   END-IF.
   1000-PARA-EXIT.
                    EXIT.
   101-WRITE-PARA.
          IF CDEP = 'SALES'
          WRITE SALE-FILE-REC.
          END-IF.
   101-WRITE-PARA-EXIT.
                             EXIT.
   PERFORM 1000-PARA UNTIL END-OF-DATABASE.

Regards,
G.P.Naidu
Back to top
View user's profile Send private message
muthuraamn

New User


Joined: 26 Nov 2003
Posts: 7
Location: chennai

PostPosted: Wed Jun 23, 2004 7:02 pm    Post subject:
Reply with quote

Hi,

In IMS We need to write call statements to database with SSA's if required.


Regards,
Muthu
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 -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am


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