Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all 8500 articles
Browse latest View live

DB2 :: RE: Query for fetching matching data in two columns

$
0
0
Author: Rohit Umarjikar
Posted: Mon Jul 09, 2018 9:24 pm (GMT 5.5)

RahulG31 is correct.
Poha Eater, Isn't it very simple to achieve what you asked, please search around on internet/this forum , hint is to use either sub query or EXIST .
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.


Suggestions & Feedback :: RE: Beginners v Experts

$
0
0
Author: Nic Clouston
Subject: Reply to: Beginners v Experts
Posted: Mon Jul 09, 2018 10:21 pm (GMT 5.5)

The reason that it is only on this forum that it is suggested that TS's should try the Beginners forum is because these two forums are provided by the same people. Other forums are not linked to either of these forums. It is bad manners to try and point someone at a competing forum but Experts and Beginners are not competing.
_________________
Regards
Nic

DB2 :: RE: DB2 LOCKSIZE=ANY - DEADLOCKS

$
0
0
Author: Rohit Umarjikar
Posted: Mon Jul 09, 2018 11:41 pm (GMT 5.5)

Usually it will be LOCKSIZE PAGE
Change to LOCKSIZE ROW and watch , if you see frequent contention.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

DB2 :: RE: DB2 LOCKSIZE=ANY - DEADLOCKS

$
0
0
Author: vasanthz
Posted: Tue Jul 10, 2018 1:31 am (GMT 5.5)

Thank you.
Would it be ok to change it to ROW without identifying what level locking was used prior to the deadlock. I thought we could go one lower level of lock than the lock that caused deadlocks
_________________
If you wear a sock inside out, the entire universe is wearing your sock except for you. **works only on socks, right legged only**

Suggestions & Feedback :: RE: Beginners v Experts

$
0
0
Author: Rohit Umarjikar
Posted: Tue Jul 10, 2018 7:16 am (GMT 5.5)

As said, My advise to keep it simple is to lock the post if moderator finds them beginners question and redirect them to beginners forum since . Since both the website are revenue generator for one company else RahulG31 is saying the market truth.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

DB2 :: row change timestamp

$
0
0
Author: charanmsrit
Subject: row change timestamp
Posted: Tue Jul 10, 2018 12:30 pm (GMT 5.5)

I have a need to capture the timestamp when any of the row columns actual changed the last time. I tried defining a table with a timestamp column definition

Code:
GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP


What I found is that the timestamp column is updated every time an UPDATE statement is executed on the row even when there is no changes to any of the column values. Is there a way to define this column so that DB2 updates the timestamp only when the row changes?

p.s: Understand that there are other ways such as TEMPORAL, Triggers etc for capturing audit but due to the application complexity and time restriction, this would be ideal.

Thanks
Charan

DB2 :: RE: Query for fetching matching data in two columns

$
0
0
Author: Poha Eater
Posted: Tue Jul 10, 2018 2:30 pm (GMT 5.5)

Hi All,

I made the slight changes in my above query and its working now. Below is the final query :

SELECT Name, Dept, Salary FROM Employee WHERE (Dept,Salary) IN (SELECT Dept, Salary FROM Employee GROUP BY Dept,Salary HAVING COUNT(*)>1);


Thanks All for your support !!

icon_smile.gif
_________________
Thanks !

DB2 :: RE: row change timestamp

$
0
0
Author: Rohit Umarjikar
Posted: Tue Jul 10, 2018 5:00 pm (GMT 5.5)

Do you think it’s worth for IBM Developers to now magical identity and compare host values vs DB values for every column and then do change the time stamp? If so then wait till that rolled out.

However, what is that you want to achieve out of it, what’s the end goal? Plus any data modeler will recommend to have time stamp column from day 1 when the table is designed for any inserts/update and programmers use them. Now few places when you can smartly not update when no value change detected program coding but one can skip that and just blunt update.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.


DB2 :: RE: Query for fetching matching data in two columns

$
0
0
Author: Rohit Umarjikar
Posted: Tue Jul 10, 2018 5:07 pm (GMT 5.5)

Good, EXISTS Is better to use it in such situations.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

CLIST & REXX :: SYMNAMES using COBDFSYM for OCCURS clause

$
0
0
Author: mistah kurtz
Subject: SYMNAMES using COBDFSYM for OCCURS clause
Posted: Tue Jul 10, 2018 5:38 pm (GMT 5.5)

Hi,

I am trying to generate the SYMNAMES using COBDFSYM, which uses Data Division Map in the compile listing to generate the symbols. However I am not able to generate the SYMNAMES for the occurs clause. In the Data Division Map, I can identify if a field is having OCCURS clause, but not able to find the number of occurrences.

Can any one let me know how to generate the SYMNAMES correctly when the copybook have occurs clause?

DB2 :: RE: Query for fetching matching data in two columns

$
0
0
Author: Poha Eater
Posted: Tue Jul 10, 2018 6:01 pm (GMT 5.5)

Hi Rohit,

I was curious so wanted to ask if there is any specific difference between EXISTS and IN which can lead to performance improvement if the table size is huge ?
_________________
Thanks !

DB2 :: RE: row change timestamp

$
0
0
Author: charanmsrit
Posted: Tue Jul 10, 2018 6:25 pm (GMT 5.5)

rohit, with all due respect I find your response a bit over board. It may be a silly question but I don’t think it deserves such a response with full of attitude, seriously?? I couldn’t find from IBM manuals if there was a way to define a row change time stamp column that actually identify a change in the row data . Thought I may have missed something and decided to throw the question in the forum for help. Anyways have now found from IBM manuals to use search condition on UPDATE statement to bypass the time stamp update when there is no change to any columns.
Thanks for your response by the way.

CLIST & REXX :: RE: SYMNAMES using COBDFSYM for OCCURS clause

$
0
0
Author: expat
Posted: Tue Jul 10, 2018 6:58 pm (GMT 5.5)

Are you really sure that this should be in the REXX / CLIST section of the forum
_________________
Some people are like Slinkies. They have no real value,
but it sure is fun to see them pushed down the stairs.

CLIST & REXX :: RE: SYMNAMES using COBDFSYM for OCCURS clause

$
0
0
Author: mistah kurtz
Posted: Tue Jul 10, 2018 7:06 pm (GMT 5.5)

COBDFSYM is a rexx program(Freeware courtesy of IBM), that's why I posted in REXX forum.

Copybook:
Code:
         01  INPUT-AREA.                                               
             05  DATA-INPUT-AREA.                                       
                 07  WS-INPUT-AREA-01                                   
                                             PIC X(1).                 
                     88  WS-VALUE-1          VALUE '1'.                 
                     88  WS-VALUE-2          VALUE '0'.                 
                 07  WS-INPUT-AREA-02                                   
                                             PIC X(4).                 
                 07  WS-INPUT-AREA-03                                   
                                             PIC S9(3)       COMP-3.   
                 07  WS-INPUT-AREA-04                                   
                                             PIC 9(2).                 
                 07  WS-INPUT-AREA-05                                   
                                             PIC S9(5)       COMP-3     
                                             OCCURS 3 TIMES             
                         INDEXED   BY WS-INPUT-AREA-05-X.               
                                                                       
                 07  WS-INPUT-AREA-06                                   
                                             PIC S9(3)       COMP-3.   

Data Division Map:
Code:
0Data Division Map
0Data Definition Attribute codes (rightmost column) have the following meanings:
     D = Object of OCCURS DEPENDING    G = GLOBAL                             S = Spanned file
     E = EXTERNAL                      O = Has OCCURS clause                  U = Undefined format file
     F = Fixed-length file             OG= Group has own length definition    V = Variable-length file
     FB= Fixed-length blocked file     R = REDEFINES                          VB= Variable-length blocked file
0Source   Hierarchy and                                    Base       Hex-Displacement  Asmblr Data                    Data Def
 LineID   Data Name                                        Locator    Blk   Structure   Definition      Data Type      Attributes
      2  PROGRAM-ID HELLO-------------------------------------------------------------------------------------------------------*
      8   1  INPUT-AREA. . . . . . . . . . . . . . . . . . BLW=00000  000               DS 0CL20        Group
      9     2  DATA-INPUT-AREA . . . . . . . . . . . . . . BLW=00000  000   0 000 000   DS 0CL20        Group
     10       3  WS-INPUT-AREA-01. . . . . . . . . . . . . BLW=00000  000   0 000 000   DS 1C           Display
     12       88 WS-VALUE-1. . . . . . . . . . . . . . . .
     13       88 WS-VALUE-2. . . . . . . . . . . . . . . .
     14       3  WS-INPUT-AREA-02. . . . . . . . . . . . . BLW=00000  001   0 000 001   DS 4C           Display
     16       3  WS-INPUT-AREA-03. . . . . . . . . . . . . BLW=00000  005   0 000 005   DS 2P           Packed-Dec
     18       3  WS-INPUT-AREA-04. . . . . . . . . . . . . BLW=00000  007   0 000 007   DS 2C           Disp-Num
     20       3  WS-INPUT-AREA-05. . . . . . . . . . . . . BLW=00000  009   0 000 009   DS 3P           Packed-Dec     O
     23          WS-INPUT-AREA-05-X. . . . . . . . . . . . IDX=00001  000                               Index-Name
     25       3  WS-INPUT-AREA-06. . . . . . . . . . . . . BLW=00000  012   0 000 012   DS 2P           Packed-Dec

CLIST & REXX :: RE: SYMNAMES using COBDFSYM for OCCURS clause

$
0
0
Author: enrico-sorichetti
Subject: Reply to: SYMNAMES using COBDFSYM for OCCURS clause
Posted: Tue Jul 10, 2018 9:00 pm (GMT 5.5)

http://ibmmainframes.com/about58496.html

but You could have found it Yourself googling with COBDFSYM
_________________
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort icon_cool.gif


DFSORT/ICETOOL :: Comparing inside same file

$
0
0
Author: vickey_dw
Subject: Comparing inside same file
Posted: Tue Jul 10, 2018 9:51 pm (GMT 5.5)

Hi
I have a below requirement. Any help is highly appreciated.

Sample input file

Code:

Daily status report

Number of PB records Read        :   5598
Number of PB records Processed   :   5598
Number of TQ records Read        :   5100
Number of TQ records Processed   :   5100


Here my requirement is if no of PB records Read is not equal to PB records processed OR if the number of TQ records Read is not equal to no of TQ records processed then this step should through RC4 else step should through RC0.

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: RahulG31
Subject: Reply to: Comparing inside same file
Posted: Tue Jul 10, 2018 10:04 pm (GMT 5.5)

Is it a challenge for others? What have YOU tried?

.

CLIST & REXX :: RE: SYMNAMES using COBDFSYM for OCCURS clause

$
0
0
Author: mistah kurtz
Subject: Re: Reply to: SYMNAMES using COBDFSYM for OCCURS clause
Posted: Wed Jul 11, 2018 12:50 am (GMT 5.5)

enrico-sorichetti wrote:
http://ibmmainframes.com/about58496.html

but You could have found it Yourself googling with COBDFSYM


Yes indeed. I did find, but It didn't answer the query that I raised. Hence re-posted.

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: mistah kurtz
Posted: Wed Jul 11, 2018 12:56 am (GMT 5.5)

Please post it into Beginner's forum.
Moderators: Please lock this topic and re-direct.

CLIST & REXX :: RE: SYMNAMES using COBDFSYM for OCCURS clause

$
0
0
Author: enrico-sorichetti
Posted: Wed Jul 11, 2018 2:24 am (GMT 5.5)

I just reread the topic ..
Quote:
The OCCURS cannot be directly reflected, no subscripting in the Sort products. You have a little extra manual or programmatic effort to give each occurence a unique name.


was the answer to Your question icon_cool.gif
_________________
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort icon_cool.gif

Viewing all 8500 articles
Browse latest View live