MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IMS DB access via Easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Fri Dec 05, 2008 5:33 am    Post subject: IMS DB access via Easytrieve Reply with quote

All,


I want to access IMS db via Easytrieve. I gone through the all help/manual also but i am not getting the clear view. It would be helpful for me atleast i see some chunk of code which is accessing IMS db via easytrieve.

if anybody has code please post on to here.


Thanks
Back to top
View user's profile Send private message
Grant
Beginner


Joined: 02 Dec 2002
Posts: 45
Topics: 1
Location: Sydney, NSW, Australia

PostPosted: Sun Dec 07, 2008 5:02 pm    Post subject: Reply with quote

Here's a fairly basic example
Code:


FILE DLIFILE DLI(DB123)                                       
  DBD-NAME          1    8   A                                 
  SEG-LEVEL         9    2   A                                 
  STATUS-CODE      11    2   A                                 
  PROC-OPTIONS     13    4   A                                 
  RESERVE-DLI      17    4   A                                 
  SEG-NAME-FB      21    8   A                                 
  LENGTH-FB-KEY    29    4   B                                 
  NUMB-SENS-SEGS   33    4   B                                 
RECORD DB123-SEG    1000                                       
                                                               
JOB INPUT NULL                                                 
                                                               
DLI DLIFILE DB123SEG 'GN'                                     
                                                               
DO WHILE STATUS-CODE EQ ' ' 'GA' 'GK'                         
                                                               
  CASE SEG-NAME-FB                                             
                                                               
  WHEN 'SEG1    '                                             
    DISPLAY 'Retrieved Segment1'                               
  WHEN 'SEG2    '                                             
    DISPLAY 'Retrieved Segment2'                               
  OTHERWISE                                                   
    DISPLAY 'Retrieved Segment ' SEG-NAME-FB                   
                                                               
  END-CASE                                                     
                                                               
  DLI DLIFILE DB123SEG 'GN'                                   
                                                               
END-DO                                                         
                                                               
IF STATUS-CODE NE 'GB'                                         
  RETURN-CODE = 0001                                           
  DISPLAY 'Error reading DB123. Status Code is ' STATUS-CODE   
END-IF

STOP
Back to top
View user's profile Send private message
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Mon Dec 08, 2008 1:00 am    Post subject: Reply with quote

Thanks for your help..

while running below code i am getting abend. I am trying to read CIFROOT DB with SSA qualifier.
Code:
10 RECORD CIFROOT 50 KEY(CIFKEY 1 13)                       
11        CIFKEY      1  13 A                               
12 JOB INPUT (DLIFILE) NAME MYPROG                         
13           RETRIEVE DLIFILE +                             
               SELECT (CIFROOT SSA 'CIFKEY = 1234567890ABC')
14           STOP 


Below is Abend msg:
A U0020 abend occurred during execution of program A180OS

12 *******A015 UNEXPECTED DBMS ERROR - DLIFILE - FEEDBACK CODE = AK - PARM LIST IS AT - 02FD1C
*******A004 CATASTROPHIC ERROR IN MODULE - D080 04 0C62


Please help me out on this abend.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Dec 08, 2008 1:30 pm    Post subject: Reply with quote

From the manuals accessed via the links above:
Code:

   AK



Explanation: For call-level programs:
An SSA contains an invalid field name, or the field name is not defined in the DBD. The number in the segment level number field of the DB PCB is the level number of the SSA that contains the invalid name.

You can also receive this status code if the program is accessing a logical child through the logical parent. DL/I returns AK if the field specified in the qualification has been defined for the logical child segment, and it includes (at least partially) the portion of the logical child that contains the concatenated key of the logical parent.

When you are using field-level sensitivity, a field you specified in the SSA has not been defined in the PSB. After this status code is returned, your position in the database is unchanged.

For command-level programs:

A WHERE option contains an invalid field name. (The field name is not defined in the DBD.) The number in the DIBSEGLV field of the DIB is the level number of the WHERE option that contains the invalid name.

Programmer Response: Correct the SSA or WHERE option.


_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Mon Jan 12, 2009 2:38 am    Post subject: Reply with quote

i am trying to read my IMS db till end of DB via easytrieve but i am s378 abend. Please help me on this.

Code:
JOB INPUT NULL
DLI DLIFILE I30XXX 'GN'                 
IF STATUS-CODE EQ ' ' 'GA' 'GK'         
    DISPLAY XX
ELSE                                   
   DISPLAY 'STATUS-CODE:' STATUS-CODE   
   STOP                                 
END-IF         




Below is the msg got from spool Abendaid

An S378 abend occurred during execution of program A000OS.

*******************************************
* Analysis of Error *
*******************************************

An error occurred when the system trien to process an RU or VRU form of
the FREEMAIN macro or the STORAGE RELEASE macro .
One of the following is true:
1. In the private area, the area specified on a FREEMAIN or STORAGE
RELEASE is larger than the area specified on the original GETMAIN or
STORAGE OBTAIN.
2. The FREEMAIN or STORAGE RELEASE start address is invalid.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group