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 get Segments with AND and OR condition

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

New User


Joined: 17 Feb 2007
Posts: 47
Location: USA

PostPosted: Mon Jan 07, 2008 11:08 pm    Post subject: How to get Segments with AND and OR condition
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    Post subject:
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts How to define PCB for paired segments ashok_uddaraju IMS DB/DC 4 Tue Jun 14, 2016 11:40 pm
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts File matching using specific condition mf_karthik DFSORT/ICETOOL 3 Fri Nov 20, 2015 11:04 pm


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