GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Mainframe  >  IDMS

 Print  |  
Question:  How to write a IDMS code to find whose employee last name is starting with J and first name starts with H.



January 01, 2009 03:33:23 #1
 amuseham   Member Since: January 2009    Total Comments: 1 

RE: How to write a IDMS code to find whose employee last name is starting with J and first name starts with H.
 
 01  WS-EMPLOYEE-NAME. 
       05  FIRST-INITIAL             PIC X.
       05  FILLER                        PIC X(29).    
......  
* WS-INITIAL-LETTER could be defined separately and set to 'J'
MOVE LOW-VALUES TO WS-EMPLOYEE-NAME.
MOVE WS-INITIAL-LETTER TO FIRST-INITIAL.
MOVE WS-EMPLOYEE-NAME TO EMPLOYEE-NAME.  
* This is randomly accessing EMPLOYEE-NAME based on a partial key / string indexed * search using a 'secondary' index which is system owned. IX-EMPLOYEE-NAME is the * system owned index in this example. 
OBTAIN EMPLOYEE-REC WITHIN IX-EMPLOYEE-NAME USING EMPLOYEE-NAME.  
........  
OBTAIN NEXT EMPLOYEE-REC WITHIN IX-EMPLOYEE-NAME.
*** The program must check for first letter in every record occurrence which it walks through that name still starts with 'J' and should exit loop / stop walking the set when when employee name does not start any longer with 'J'. 
     

 

Back To Question