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: Wed Jul 11, 2018 3:03 am (GMT 5.5)

The Exists keyword evaluates true or false, but IN keyword compare all value in the corresponding sub query column. So the result data of the subquery needs to be loaded first to get compared against outer query regardless of matches
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.


DB2 :: RE: row change timestamp

$
0
0
Author: Rohit Umarjikar
Posted: Wed Jul 11, 2018 3:12 am (GMT 5.5)

charanmsrit, I don't want to respond to your arguments or observation since that's not why we here for, are we?
Quote:
IBM manuals to use search condition on UPDATE statement to bypass the time stamp update when there is no change to any columns.

If you get time , explain further to what is this approach ? Are you now changing the application program for this? I thought you don't wanted to.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

TSO/ISPF :: KSDS file fields update by passing values from ISPF pannel

$
0
0
Author: Anil Kumar Prajapati
Subject: KSDS file fields update by passing values from ISPF pannel
Posted: Wed Jul 11, 2018 5:59 am (GMT 5.5)

I have an existing ISPF pannel having many options..As per new requirement we have to add one more option ..Which will be used to pass some values to update few fields of ksds file. Could you please help me how i can achieve this.

Regards,
Anil Kumar Prajapati
mobile number removed

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

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

Sorry for not being clear. My question was how to determine the number of occurrences using the compile listing which this COBDFSYM macro uses?

TSO/ISPF :: RE: KSDS file fields update by passing values from ISPF pannel

$
0
0
Author: expat
Posted: Wed Jul 11, 2018 11:42 am (GMT 5.5)

REPRO out to a dataset, update the dataset, REPRO REPLACE back in

or

The selected ISPF option invokes a program

or

The selected ISPF option triggers a job via the schedular
_________________
Some people are like Slinkies. They have no real value,
but it sure is fun to see them pushed down the stairs.

TSO/ISPF :: RE: KSDS file fields update by passing values from ISPF pannel

$
0
0
Author: Willy Jensen
Posted: Wed Jul 11, 2018 1:34 pm (GMT 5.5)

If it is only update of a few of records then I would use the RXVSAM program from www.cbttape.org file 268. If installing shareware is not an option, then look at the REPRO command as expat suggested. Or check if you have FileManager installed, that might be easier.
_________________
WJ

JCL & VSAM :: Remove duplicate record with condition

$
0
0
Author: rajiv rengasamy
Subject: Remove duplicate record with condition
Posted: Wed Jul 11, 2018 3:55 pm (GMT 5.5)

Hello All,
I have an input file of fixed length 300 characters, my activity is focused on two fields Order number and status code.

Code:
Order number                                    status code
(Position 25, length 7 characters)       (Position 102, length 3 characters)
Order1                                              020
Order1                                              025
Order2                                              020
Order3                                              025
Order4                                              020
Order4                                              025


If there are two records with same order number then I want to remove the record having status code “025”.So the output file should look like the below

Code:
Order number                                    status code
(Position 25, length 7 characters)        (Position 102, length 3 characters)
Order1                                              020
Order2                                              020
Order3                                              025
Order4                                              020


Note the input file is pre-sorted on order number and status code.
I tried few Sort options, but it was removing the first record which is associated with status code “020”.Any help is appreciated.

Regards,
Rajiv R

CODED

JCL & VSAM :: RE: Remove duplicate record with condition

$
0
0
Author: expat
Posted: Wed Jul 11, 2018 3:59 pm (GMT 5.5)

Please show the code that you have used and did not give the required results.

Will there only ever be two records for each order, or more
_________________
Some people are like Slinkies. They have no real value,
but it sure is fun to see them pushed down the stairs.


JCL & VSAM :: RE: Remove duplicate record with condition

$
0
0
Author: rajiv rengasamy
Posted: Wed Jul 11, 2018 4:38 pm (GMT 5.5)

Yes your correct there can be only maximum two records with same order number, one with status code 020 and other with status code 025,of which the record with status code 025 needs to be removed.


Sorry i was testing with the presorted file,that's the reason it was deleting the record with status code 020.
I tried using sorted file and gives desired result.

The below are options i used

1) Option 1
Code:

//S2      EXEC PGM=ICEMAN
//SYSOUT  DD   SYSOUT=*
//SORTIN  DD   DSN=racfid.TEST.FCAST.UNSOLVD,DISP=SHR
//SORTOUT DD   DSN=racfid.TEST.FCAST.UNSOLVD.SORTED.ICEMAN,
//             DISP=(,CATLG),
//             SPACE=(CYL,(500,500),RLSE),
//             RECFM=FB,
//             LRECL=300
//SYSIN    DD    *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(301:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(102,3,CH,EQ,C'025'),OVERLAY=(301:8C'0'))
  SORT FIELDS=(25,7,CH,A)
  SUM FIELDS=NONE
  OUTREC FIELDS=(1,300)
/*

2)Option 2:
Code:

//S3      EXEC PGM=SORT
//SYSOUT  DD   SYSOUT=*
//SORTIN  DD   DSN=racfid.TEST.FCAST.UNSOLVD.SORTED,DISP=SHR
//SORTOUT DD   DSN=racfid.TEST.FCAST.UNSOLVD.SORTED.SORT,
//             DISP=(,CATLG),
//             SPACE=(CYL,(500,500),RLSE),
//             RECFM=FB,
//             LRECL=300
//SYSIN    DD    *
  SORT FIELDS=(25,7,CH,A)
  SUM FIELDS=NONE
/*


3) Option 3:
Code:

//S4    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN      DD DSN=racfid.TEST.FCAST.UNSOLVD.SORTED,DISP=SHR
//FIRST   DD DSN=racfid.TEST.FCAST.UNSOLVD.SORTED.NODUP,
//         DISP=(,CATLG),
//         SPACE=(CYL,(500,500),RLSE),
//         RECFM=FB,
//         LRECL=300
//REST    DD DSN=racfid.TEST.FCAST.UNSOLVD.SORTED.DUP,
//         DISP=(,CATLG),
//         SPACE=(CYL,(500,500),RLSE),
//         RECFM=FB,
//         LRECL=300
//TOOLIN DD *
SELECT FROM(IN) TO(FIRST) ON(25,7,CH) FIRST DISCARD(REST)
/*

In all three options it worked fine,only i was using the presorted input file.
Thank you so much for intention to help.
_________________
Regards,
Rajiv R

JCL & VSAM :: RE: Remove duplicate record with condition

$
0
0
Author: expat
Posted: Wed Jul 11, 2018 5:12 pm (GMT 5.5)

Here's a quick snippet of code that may help you, NOT tailored to your needs because I'm busy right now, but may help you out

Use EXCLUDE instead of INCLUDE, also might work in conjunction with your writing 8 x 0 at pos 301
Code:

  OPTION  VLSHRT VLSCMP
  SORT    FIELDS=(29,44,A),FORMAT=CH
  OUTFIL  INCLUDE=(9,2,CH,EQ,C'M ',AND,
                29,44,SS,EQ,C'AB.L00T304A.LABEL'),
          OUTREC=(1,4,29,44,1X,233,6)


Good luck
_________________
Some people are like Slinkies. They have no real value,
but it sure is fun to see them pushed down the stairs.

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

$
0
0
Author: Poha Eater
Posted: Wed Jul 11, 2018 8:32 pm (GMT 5.5)

Got it. Thanks again Rohit icon_smile.gif
_________________
Thanks !

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: Arun Raj
Posted: Wed Jul 11, 2018 9:12 pm (GMT 5.5)

vickey_dw,

Do you know what creates this file (or data set)? If it is something that is generated by your system, would it not be easier to check it while it is being written and issue an RC accordingly.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard

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

$
0
0
Author: Rohit Umarjikar
Posted: Wed Jul 11, 2018 9:16 pm (GMT 5.5)

If you are executing the above query in online and the below table only gets updated in batch then I would suggest to create a new table and insert to it only when below condition is met and use that table in online as a inner join. This approach will avoid group by every time you hit the sp.
Code:
(SELECT Dept, Salary FROM Employee GROUP BY Dept,Salary HAVING COUNT(*)>1);


_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: Rohit Umarjikar
Posted: Wed Jul 11, 2018 9:22 pm (GMT 5.5)

I concur with mistah Kurtz.

I think , No rules are yet set as to what needs to be done when Beginners questions are posted here, may be until them continue to answer them.

In Other way if no one ask on Beginners forum and regardless post here then the Beginners forum shall go away automatically.
_________________
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: Rohit Umarjikar
Posted: Wed Jul 11, 2018 9:30 pm (GMT 5.5)

LOCKSIZE ROW is the lower level than LOCKSIZE PAGE. I don't think LOCKSIZE ANY would use LOCKSIZE ROW by itself in a situations like when LOCKSIZE PAGE is not sufficient.

I would look at LOCK ESCALATIONS too to know what it is defined.

This is my understanding but double check with DBA and if its different than above then I would learn something.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.


DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: Arun Raj
Posted: Wed Jul 11, 2018 9:31 pm (GMT 5.5)

Can we please hold on, on the beginners vs experts thing and focus on the topic/posts relevant to the problem, especially when only the OP knows about the details of it.

Quote:
In Other way if no one ask on Beginners forum and regardless post here then the Beginners forum shall go away automatically
That could be a possibility.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard

DFSORT/ICETOOL :: RE: Remove duplicate record with condition

$
0
0
Author: Arun Raj
Posted: Wed Jul 11, 2018 10:10 pm (GMT 5.5)

If the file is already sorted on the 2 fields, you may not need to sort it again.

You could use a COPY override in your Option3. Or something like this in your Options1/2. [UNTESTED]
Code:
//SYSIN    DD *
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(25,7),
        PUSH=(301:SEQ=1))
  SORT FIELDS=COPY
  OUTFIL INCLUDE=(301,1,ZD,EQ,1),BUILD=(1,301)

_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: Rohit Umarjikar
Posted: Thu Jul 12, 2018 12:06 am (GMT 5.5)

Quote:
Can we please hold on, on the beginners vs experts thing and focus on the topic/posts relevant to the problem, especially when only the OP knows about the details of it
. That is what I have said it above , haven't I? It don't matter what OP knows, if he knows he would have Goggled it and got the answer by now instead of spinning around as similar topics and concepts have been discussed many a times in past.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: Arun Raj
Posted: Thu Jul 12, 2018 3:20 am (GMT 5.5)

Locking the topic is not just the only thing we can do. With just one post from the OP, all we can do is speculate what is going on. To me, there is nothing wrong in asking questions and know more about what we are dealing with, instead of jumping into conclusions.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard

DFSORT/ICETOOL :: RE: Comparing inside same file

$
0
0
Author: Rohit Umarjikar
Posted: Thu Jul 12, 2018 4:54 am (GMT 5.5)

I gave my honest opinion as others and you did yours. If you lock and TS still wants to get the answer the. He must google and try himself if he couldn’t get it then say what he tried and post it and none happen in this case. So setting the wrong expectations to all users that to post anything and make this site as “Do my job for free”. No one would ever learn.

Second, If you think what you are doing is right then just do it but when others have some point who are also expected to be treated equally important then just ignoring them and continue to entertain such beginners post isn’t the right way to handle the situation being Moderator.

I hope McMillan would step in soon to set some rules around it.
_________________
Regards,
Rohit Umarjikar
A leader is one who knows the way, goes the way, and shows the way.

Viewing all 8500 articles
Browse latest View live