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

Need to create an SSA with mulitple conditions.


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

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Thu Jul 17, 2008 5:42 pm
Reply with quote

I need to create an SSA in for a DB, say proration db.
For the proration db - hierarchy is SPRPPR01(root) ----SPRPPR10(child)

1. The key field for SPRPPR01 is PBILL. The search field is DATE.

2. I need to create an SSA for SPRPPR01 with multiple conditions.

3. The condition is it should retrieve all the records between a date range. For example, it should retrieve the occurences for sprppr01 with date greater than 062208 and less than 071408. How can i create an SSA for this.

Currently the one i have created is giving AK status code.

I will give you the current ssa which is in error. Please tell me how should i modify it to make it correct.?

01 WS-SPRBSSAS.
03 WS-SSA-SPRPPR01.
05 SGN-SPRPPR01 VALUE 'SPRPPR01'
PIC X(8).
05 CCA-SPRPPR01 VALUE '*'
PIC X(1).
05 CCF-SPRPPR01 VALUE '-'
PIC X(1).
05 CCL-SPRPPR01 VALUE '-'
PIC X(1).
05 CCD-SPRPPR01 VALUE '-'
PIC X(1).
05 CCN-SPRPPR01 VALUE '-'
PIC X(1).
05 CCC-SPRPPR01 VALUE '-'
PIC X(1).
05 CCU-SPRPPR01 VALUE '-'
PIC X(1).
05 CCV-SPRPPR01 VALUE '-'
PIC X(1).
05 CCP-SPRPPR01 VALUE '-'
PIC X(1).
05 BQ-SPRPPR01 VALUE '('
PIC X(1).
05 FLN-SPRPPR01-BILLDATE
VALUE 'BILLDATE'
PIC X(8).
05 RO-SPRPPR01-BILLDATE VALUE '>='
PIC XX.
05 VALUE-SPRPPR01-BILLDATE
PIC 9(09).
05 EQ-SPRPPR01-BILLDATE VALUE '&'
PIC XX.
05 BO-SPRPPR01 REDEFINES EQ-SPRPPR01-BILLDATE
PIC X.
05 FLN-SPRPPR01-BILLDATE1
VALUE 'BILLDATE'
PIC X(8).
05 RO-SPRPPR01-BILLDATE1 VALUE '<='
PIC XX.
05 VALUE-SPRPPR01-BILLDATE1
PIC 9(09).
05 EQ-SPRPPR01-BILLDATE1 VALUE ')'
PIC XX.

Currently this is giving AK - SSA ERROR status code?Please help.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Jul 17, 2008 11:45 pm
Reply with quote

WOW - do you know how to put together a boolean SSA? Can we see the dbd for the key fields? You are probably getting the AK status code because you have defined the key field in your SSA incorrectly.
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Thu Jul 17, 2008 11:55 pm
Reply with quote

Actually I am not using any key field in the ssa. I am using the search field only. Search field is BILLDATE. if you want to see the dbd..here it is ...
DBD NAME=SPRB0000,
ACCESS=(HDAM,OSAM),
RMNAME=(DFSHDC40,9,3150)
DSG001 DATASET DD1=SPRD0001,
DEVICE=3390,
SIZE=8192,
SCAN=0
SEGM NAME=SPRPPR01,
PARENT=0,
BYTES=100,
PTR=(T)
FIELD NAME=(PR01KEY,SEQ,U),
TYPE=C,
BYTES=07,
START=1
FIELD NAME=BILLDATE,
TYPE=C,
BYTES=06,
START=8
------- continued
So you are saying that the issue may be due to BILLDATE X(06) in dbd not matching with BILLDATE 9(09) COMP-3. right..???

Regarding BOOLEAN SSA - I have some idea of BOOLEAN ssa- if i correct the definition to BILLDATE x(06) in SSA --- Can you tell me how to code the boolean ssa to get the dates within the range I have specified.

I have some idea of BOOLEAN ssa.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Fri Jul 18, 2008 12:43 am
Reply with quote

Try adding the key field to your boolean ssa immediately preceding your search field. In the first part of your boolean ssa initialize the 7 byte key value to low-values and make the operator >. In the second part of your boolean - load the ssa key value with high values and make the operator <.

For initial testing of your boolean ssa, init the billdate in the first part of your boolean to low values and high values in the second part. Run thru just a handful of segments and see what you get.

If this works - then we are almost there. Then we will deal with the date.
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Fri Jul 18, 2008 1:02 am
Reply with quote

Sorry. I am confused about what you have said.

Actually my aim is to read the segment sequentially using get next call and the segment needs to be retrieved only if the 'BILLDATE' comes in a particular range. Otherwise I don't want the retrieved segment. So I need an SSA which does not use the key field(PBILL) but only the search field(billdate).

Hope you got the requirement. I am a little confused. Can you look from the requirement point of view. It would be really helpful. And thanks for your time. icon_smile.gif
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Fri Jul 18, 2008 1:42 am
Reply with quote

I know.....there are different ways that you can do this. Behind the scenes, IMS is looking at every segment. Unless you do an unqualified SSA, you need to define the key field in the SSA. Another way to approach it would be to do an unqualifed SSA and then interrogate the value of the BILLDATE.
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Fri Jul 18, 2008 1:52 am
Reply with quote

So Sandy, u are asking me to first create an SSA like
GETNEXT SPRPPR01*(PBILL>highvalues & PBILL<LOWVALUES) and tr y running the program and if this works then we can try with the dates. Aren't you?

Please correct me if i am wrong.
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Fri Jul 18, 2008 1:54 am
Reply with quote

sorry ssa must be

GN SPRPPR01*(PBILL>HIGHVALUES & PBILL < LOW VALUES & DATE > LOW VALUES & DATE < LOW VALUES)

isn't this the one you are asking me to do.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Fri Jul 18, 2008 2:03 am
Reply with quote

GN SPRPPR01*(PBILL>lowVALUES date >lowvalues & PBILL<highVALUES date <highVALUES)

There is nothing lower than low values and nothing higher than high values.

Let's just get the SSA coded with all the fields - test it with low and high values for just a few segments - then we can adjust it.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Jul 21, 2008 4:53 pm
Reply with quote

One more thing - what makes you think that billdate is a search field?
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 load to DB2 with column level ... DB2 6
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Db2 SQL - how to switch among differe... DB2 18
No new posts To search DB2 table based on Conditio... DB2 1
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top