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

DFSORT/ICETOOL :: RE: Select first 2 group data

$
0
0
Author: Bill Woodger
Subject: Reply to: Select first 2 group data
Posted: Tue Jun 14, 2016 7:45 am (GMT 5.5)

Rohit,

You've over-engineered yours by trying to get a 1/2 answer, when LT 2 would do. With WHEN=GROUP you'd need to do that subtraction, so it basically does work.

magesh23586's solution works like this.

The first RESTART will get each entire key numbered from 1-N. Of these, 2-N are unimportant, it is the "1" marking the start of the groups which is important.

The second RESTART only operates on the "1"s, so the first "1" will get "1", the second "2", the others are then irrelevant.

Having only marked the first record of each group with the second RESTART, the WHEN=GROUP on OUTREC propagates that to all the records in the group, then the INCLUDE= can pick all the records marked with 1s or 2s.

The sequence numbers need to be large enough to cover the number of records within a group, else mayhem will, as usual, ensue.

If a SORT were required as well, things could be different (due to the use of OUTREC because WHEN=GROUP cannot follow WHEN=(logicalexpression)). Depends on the data and the actual requirement for that case.

Here's an alternate. Since the records which aren't wanted aren't wanted, you can destroy them (or a byte of them) to indicate they are not wanted.

This can also be applied to Rohit's solution which works even if a SORT is needed.

Code:
 OPTION COPY
 INREC  IFTHEN=(WHEN=INIT,
                OVERLAY=(81:SEQNUM,2,ZD,RESTART=(1,10))),
        IFTHEN=(WHEN=(81,2,CH,EQ,C'01'),
                OVERLAY=(83:SEQNUM,2,ZD,RESTART=(1,5)))
 OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(83,2,CH,NE,C'  '),
                PUSH=(85:83,2)),
        IFTHEN=(WHEN=(85,2,CH,GT,C'02'),
                OVERLAY=(1:C' ')),
        IFOUTLEN=16
 OUTFIL OMIT=(1,1,CH,EQ,C' ')


DFSORT/ICETOOL :: RE: Select first 2 group data

$
0
0
Author: vice_versa
Posted: Tue Jun 14, 2016 1:47 pm (GMT 5.5)

It is OK
thanks you very much

Rohit Umarjikar wrote:
Try this card.
Code:
//SYSIN    DD *                                                   
   SORT FIELDS=COPY                                               
   INREC IFOUTLEN=80,                                             
   IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,11),PUSH=(81:ID=8)),           
   IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,5),PUSH=(89:81,8)),             
   IFTHEN=(WHEN=INIT,                                             
   OVERLAY=(40:+1,ADD,(81,8,ZD,SUB,89,8,ZD),M11,LENGTH=3))       
   OUTFILE INCLUDE=(40,3,ZD,EQ,001,OR,40,3,ZD,EQ,002),BUILD=(1,16)

Suggestions & Feedback :: Always notify me of NEW TOPICS ?

$
0
0
Author: Rohit Umarjikar
Subject: Always notify me of NEW TOPICS ?
Posted: Tue Jun 14, 2016 9:30 pm (GMT 5.5)

Team,
Currently we get email notifications upon "Always notify me of replies:" but is there a way or can be away to get emails upon any "New post" as well on the forum?
_________________
Regards,
Rohit Umarjikar
"Some things Man was never meant to know. For everything else, there's Google"

IMS DB/DC :: How to define PCB for paired segments

$
0
0
Author: ashok_uddaraju
Subject: How to define PCB for paired segments
Posted: Tue Jun 14, 2016 11:40 pm (GMT 5.5)

I am trying to define PCB for the below virtually paired segments

SEGM NAME=P999NUP,PTR=PAIRED,
PARENT=P999NCH,
SOURCE=((P999NDN,D,DB0999))
FIELD NAME=(PNUPKEY,SEQ,U),BYTES=6,START=1,TYPE=C
SEGM NAME=P999NDN,BYTES=6,PTR=(TB,LT,LP),
PARENT=((P999NCH),(P999NCH,P,DB999)),
RULES=(VVV)
FIELD NAME=(PNDNKEY,SEQ,U),BYTES=6,START=1,TYPE=C

can you please help me on how to put the parent/child relationship in PCB ?

i know how it works for regular segments.

IMS DB/DC :: RE: How to define PCB for paired segments

$
0
0
Author: Rohit Umarjikar
Posted: Wed Jun 15, 2016 1:04 am (GMT 5.5)

I would contact DBA first.
When you Gogle 'virtually paired logical relationships' then pick first two links and understand how the logical pointers works.
_________________
Regards,
Rohit Umarjikar
"Some things Man was never meant to know. For everything else, there's Google"

IMS DB/DC :: RE: How to define PCB for paired segments

$
0
0
Author: ashok_uddaraju
Posted: Wed Jun 15, 2016 2:16 am (GMT 5.5)

000002 PCB TYPE=DB,DBDNAME=DB0999,KEYLEN=12,PROCOPT=AP
000003 SENSEG NAME=P999NCH,PARENT=0,PROCOPT=GOP
000004 SENSEG NAME=P999CCD,PARENT=P999NCH
000005 SENSEG NAME=P999BFD,PARENT=P999NCH
000006 SENSEG NAME=P999NDN,PARENT=P999NCH
000007 SENSEG NAME=P999CPS,PARENT=P999NCH
000008 *
000009 *
000010 PSBGEN PSBNAME=DB0999U,LANG=COBOL,CMPAT=YES
000011 END

does Paired virtual segments are also defined the same way ?

COBOL Programming :: RE: File Stauts 92 with member of PDS

$
0
0
Author: sandip_mainframe
Posted: Wed Jun 15, 2016 11:13 am (GMT 5.5)

Hi Enrico And Steve thanks for your replies, I am able to resolve to the issue. Issue was that data was not copied properly into PDS members there was some junk data and because of which program was abending with file status 92.


Thanks,
Sandip

IMS DB/DC :: RE: How to define PCB for paired segments

$
0
0
Author: ashok_uddaraju
Posted: Thu Jun 16, 2016 12:29 am (GMT 5.5)

This how the DBD is defined

SEGM NAME=P999NUP,PTR=PAIRED,
PARENT=P999NCH,
SOURCE=((P999NDN,D,DB0999))
FIELD NAME=(PNUPKEY,SEQ,U),BYTES=6,START=1,TYPE=C
SEGM NAME=P999NDN,BYTES=6,PTR=(TB,LT,LP),
PARENT=((P999NCH),(P999NCH,P,DB0999)),
RULES=(VVV)
FIELD NAME=(PNDNKEY,SEQ,U),BYTES=6,START=1,TYPE=C


COBOL Programming :: RE: File Stauts 92 with member of PDS

$
0
0
Author: Rohit Umarjikar
Posted: Thu Jun 16, 2016 2:56 am (GMT 5.5)

Really ? What was junk ? icon_confused.gif
_________________
Regards,
Rohit Umarjikar
"Some things Man was never meant to know. For everything else, there's Google"

DFSORT/ICETOOL :: Next max

$
0
0
Author: kgumraj2
Subject: Next max
Posted: Thu Jun 16, 2016 10:50 am (GMT 5.5)

Hi,
I searched forums but could not find. Could you please help me.

I have a input file with below layout

Code:
CLIENT-1   2016-01-01   HMO
CLIENT-2   2016-01-01   090
CLIENT-2   2016-02-01   520
CLIENT-2   2016-02-03   HMO
CLIENT-2   2016-03-01   
CLIENT-2   2016-04-01   520
CLIENT-2   2016-05-01   090

( Imagine: cleint filed is 8 char, date is 10 char, client_ty is 3 charaters and file is sorted on client, date ( asec))

when the 3rd field is has spaces, the output has to be like this

Code:
CLIENT-1   2016-01-01   HMO   NS
CLIENT-2   2016-01-01   090   NS
CLIENT-2   2016-02-01   520   NS
CLIENT-2   2016-02-03   HMO   NS
CLIENT-2   2016-03-01   520   SP
CLIENT-2   2016-04-01   520   NS
CLIENT-2   2016-05-01   090   NS

That is next client_ty of that client has to be updated ( in this case 520) and 4th field should be SP ( means spaces) and for non spaces ( NP).
In case we have spaces and there is only one record for that client, we have to update HMO and 4th field as SP

Kindly help me on this. Thanks

code' d
_________________
Have a Great Day !!!
Kiran G R

Java & MQSeries :: RE: MQ Related Queries

$
0
0
Author: csudhir
Posted: Thu Jun 16, 2016 1:10 pm (GMT 5.5)

Business environments are constantly changing. Applications that were written 20 years ago need to exchange data with applications written last week. The core data can be held in a database on a mainframe, but a user of a browser requires a front-end web application server to interact with that database. Messaging is an effective way to connect these systems. It hides many of the details of communication from the application developer and gives a simple interface.
Many mechanisms for communicating between applications require that both applications are available at the same time. Messaging uses an asynchronous model, which means that an application that generates messages does not have to execute at the same time as an application that consumes those messages.
Asynchrony is used in various ways. It can queue large volumes of work, and that work is then submitted once a day by a batch process. Or, work can be submitted immediately and then processed as soon as the receiving application finishes dealing with a previous request. Asynchronous processing does not imply long response times. Many applications were built and successfully execute by using messaging for real-time interactive operations.
Business transactions normally happen exactly once. Middleware needs to ensure all the systems that are involved in that transaction do their job, exactly once. There must be no loss or duplication.

Data is transferred between applications in messages. A message is a container that consists of three parts: WebSphere MQ Message Descriptor (MQMD): Identifies the message and contains additional control information. Message data: Contains the application data. The structure of the data is defined by the application programs that use it, and WebSphere MQ is largely unconcerned with its format or content. The nodes, within a WebSphere MQ message queuing infrastructure, are called queue managers. The queue manager is responsible for accepting and delivering messages.

Placing a WebSphere MQ infrastructure between the two applications allows this communication to become asynchronous. One application places information for the partner in a message on a queue, and the partner application processes this information when it is available to do so. If required, it can then send a reply message back to the originator. The applications do not need to be concerned with communication failures or recovery.

Java & MQSeries :: RE: MQ Related Queries

$
0
0
Author: enrico-sorichetti
Subject: Reply to: MQ Related Queries
Posted: Thu Jun 16, 2016 1:14 pm (GMT 5.5)

any reason to tailgate to a FIVE YEARS OLD TOPIC ? icon_evil.gif

topic locked to prevent further stupidity
_________________
cheers
enrico
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 :: RE: Next max

$
0
0
Author: Nic Clouston
Posted: Thu Jun 16, 2016 1:53 pm (GMT 5.5)

Apart from the fact that you did not help the helpers by using the code tags, and you say NP should be inserted into the 4th field when the third field is not blank but you show NS, and that you have a dataset not a file and you did not specify LRECL or RECFM (either, or both, of which could affect the solution), and you say that the next client_ty has to be updated when I suspect that that should say that if the client_ty is blank it should be updated with the client_ty of the next client record. But what if there is no 'next' client_ty?
_________________
Regards
Nic

IMS DB/DC :: RE: How to define PCB for paired segments

$
0
0
Author: Nic Clouston
Posted: Thu Jun 16, 2016 1:57 pm (GMT 5.5)

Use the code tags! That is 3 posts by you in one thread without once using the code tags. You have been here long enough to know that they should be used and how to use them.

And, have you been to your DBA yet?
_________________
Regards
Nic

DFSORT/ICETOOL :: RE: Next max

$
0
0
Author: kgumraj2
Posted: Thu Jun 16, 2016 2:47 pm (GMT 5.5)

Thanks for your reply and time.

Nic- you say NP should be inserted into the 4th field when the third field is not blank but you show NS
Kiran- Yes you are correct it should be NS

Nic- that you have a dataset not a file and you did not specify LRECL or RECFM (either, or both, of which could affect the solution)
Kiran- I have mentioned in the first message ( cleint filed is 8 char, date is 10 char, client_ty is 3 charaters and file is sorted on client, date ( asec)), in addition to that, it is 80 length FB PS file.

Nic- you say that the next client_ty has to be updated when I suspect that that should say that if the client_ty is blank it should be updated with the client_ty of the next client record. But what if there is no 'next' client_ty?
Kiran- I have mentioned in my first message In case we have spaces and there is only one record for that client, we have to update HMO and 4th field as SP
_________________
Have a Great Day !!!
Kiran G R


DFSORT/ICETOOL :: RE: Next max

$
0
0
Author: enrico-sorichetti
Subject: Reply to: Next max
Posted: Thu Jun 16, 2016 2:59 pm (GMT 5.5)

If You want to be considered in a more professional way
You should update your profile with professional data
not childish info like
Quote:
Mainframe Skills: Reading


if Your skills are only Reading
who wrote the post on Your behalf ?
_________________
cheers
enrico
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

Suggestions & Feedback :: RE: Always notify me of NEW TOPICS ?

$
0
0
Author: mcmillan
Posted: Thu Jun 16, 2016 4:02 pm (GMT 5.5)

We used to have that facility (forum subscription) but removed it to reduce the server load.
_________________
Ever Loving,
McMillan

--------------------------------------------------------------------
We are not here to Stay, we are here to Live.
--------------------------------------------------------------------
IBMmainframes.com => World's biggest FAN Club of Mainframe Computers since 1998 - Perfection thru Performance
IbmMainframeForum.com =>A help & support Forum for Mainframe Beginners& Students - No more Bans & Warns
MainframesIndia.com => All in one Mainframe Products& Learning DVD Pack - Master the Mainframes

DFSORT/ICETOOL :: RE: Next max

$
0
0
Author: sqlcode1
Posted: Thu Jun 16, 2016 8:59 pm (GMT 5.5)

Kiran,
See if this works for you.

Code:
//STEP0001 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTJNF1 DD *                                                     
CLIENT-1   2016-01-01   HMO                                         
CLIENT-2   2016-01-01   090                                         
CLIENT-2   2016-02-01   520                                         
CLIENT-2   2016-02-03   HMO                                         
CLIENT-2   2016-03-01                                               
CLIENT-2   2016-04-01   520                                         
CLIENT-2   2016-05-01   090                                         
//SORTJNF2 DD *                                                     
CLIENT-1   2016-01-01   HMO                                         
CLIENT-2   2016-01-01   090                                         
CLIENT-2   2016-02-01   520                                         
CLIENT-2   2016-02-03   HMO                                         
CLIENT-2   2016-03-01                                               
CLIENT-2   2016-04-01   520                                         
CLIENT-2   2016-05-01   090                                         
//SORTOUT  DD SYSOUT=*                                             
//SYSIN DD *                                                       
 JOINKEYS FILE=F1,FIELDS=(01,08,A,81,8,A),SORTED,NOSEQCK           
 JOINKEYS FILE=F2,FIELDS=(01,08,A,81,8,A),SORTED,NOSEQCK           
 JOIN UNPAIRED,F1                                                   
 REFORMAT FIELDS=(F1:1,80,F2:25,3)                                 
 INREC IFOUTLEN=80,                                                 
       IFTHEN=(WHEN=INIT,OVERLAY=(31:C'NS')),                       
       IFTHEN=(WHEN=(25,3,CH,EQ,C' '),OVERLAY=(25:81,3,31:C'SP'))   
 SORT FIELDS=COPY                                                   
/*                                                                 
//JNF1CNTL DD *                                                     
 INREC OVERLAY=(81:SEQNUM,8,ZD,START=2,INCR=1,RESTART=(1,8))       
/*                                                                 
//JNF2CNTL DD *                                                     
 INREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,8))                       
/*                                                                 


OUTPUT
Code:
CLIENT-1   2016-01-01   HMO   NS
CLIENT-2   2016-01-01   090   NS
CLIENT-2   2016-02-01   520   NS
CLIENT-2   2016-02-03   HMO   NS
CLIENT-2   2016-03-01   520   SP
CLIENT-2   2016-04-01   520   NS
CLIENT-2   2016-05-01   090   NS


Thanks,

DFSORT/ICETOOL :: RE: Next max

$
0
0
Author: kgumraj2
Subject: Reply to: Next max
Posted: Thu Jun 16, 2016 11:16 pm (GMT 5.5)

Thanks I will give a try. Thanks very much for your time.
_________________
Have a Great Day !!!
Kiran G R

DFSORT/ICETOOL :: RE: Next max

$
0
0
Author: Rohit Umarjikar
Posted: Thu Jun 16, 2016 11:21 pm (GMT 5.5)

Please test, little modification on what TS wants about HMO.
Code:
IFTHEN=(WHEN=INIT,OVERLAY=(31:C'NS')),                   
IFTHEN=(WHEN=(25,3,CH,EQ,C' ',AND,81,3,CH,NE,C' '),     
                          OVERLAY=(25:81,3,31:C'SP')),   
IFTHEN=(WHEN=(25,3,CH,EQ,C' ',AND,81,3,CH,EQ,C' '),     
                          OVERLAY=(25:C'HMO',31:C'SP')) 

I hope TS don't have the same client appearing twice with blank client_ty.
_________________
Regards,
Rohit Umarjikar
"Some things Man was never meant to know. For everything else, there's Google"

Viewing all 8500 articles
Browse latest View live