IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get Segments with AND and OR condition


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Mon Jan 07, 2008 11:08 pm
Reply with quote

As I am New to IMS I need some information on getting segments based on AND and OR condition. I have SSA declaration as below.

Code:
01  R300-SSA.                                               
    02  FILLER                  PIC X(8)   VALUE 'RR300000'.
    02  RR300-CMNDS      PIC X(4)   VALUE '*---'.     
    02  FILLER                  PIC X(9)   VALUE '(RR300SEQ'.
    02  RR300-OPER         PIC XX     VALUE 'EQ'.       
    02  RR300-SSA-KEY    PIC X(22).                   
    02  FILLER                  PIC X      VALUE ')'.     


Can anyone please let me know how to put AND and OR condition if I do not know the Key (As we put in DB2 SQL WHERE condition) ?

For example I want to READ records with RR300-FRB-IND as well as RR300-BLN. But these are not Key Fields. How should I modify above layout ?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Tue Jan 08, 2008 3:57 am
Reply with quote

Use asterisk * or ampersand & to indicate logical AND. Use plus sign or vertical bar to indicate a logical OR.

Code:
01  R300-SSA.                                               
    02  FILLER                  PIC X(8)   VALUE 'RR300000'.
    02  RR300-CMNDS      PIC X(4)   VALUE '*---'.     
    02  FILLER                  PIC X(9)   VALUE '(RR300SEQ'.
    02  RR300-OPER         PIC XX     VALUE 'EQ'.       
    02  RR300-SSA-KEY    PIC X(22).                   
    02  RR300-CMNDS      PIC X(1)   VALUE '&'.     
    02  FILLER                  PIC X(9)   VALUE '(RR300XXX'.
    02  RR300-OPER         PIC XX     VALUE 'EQ'.       
    02  RR300-SSA-FLD2   PIC X(22).                   
    02  FILLER                  PIC X      VALUE ')'. 
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Tue Jan 08, 2008 4:34 am
Reply with quote

A few corrections to my previous post:
Code:
01  R300-SSA.                                               
    02  FILLER           PIC X(8)   VALUE 'RR300000'.
    02  RR300-CMNDS      PIC X(4)   VALUE '*---'.     
    02  FILLER           PIC X(9)   VALUE '(RR300FRB'.
    02  RR300-OPER       PIC XX     VALUE 'EQ'.       
    02  RR300-SSA-FRB    PIC X(22)  VALUE SPACES.                   
    02  FILLER           PIC X(1)   VALUE '&'.     
    02  FILLER           PIC X(8)   VALUE 'RR300BLN'.
    02  RR300-OPER       PIC XX     VALUE 'EQ'.       
    02  RR300-SSA-BLN    PIC X(22)  VALUE SPACES.                   
    02  FILLER           PIC X      VALUE ')'.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
No new posts Dynamic condition checks COBOL Programming 5
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top