| Author |
Message |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 153 Location: Pune
|
|
|
|
Frank,
I have a input File FB=200
Records like below
| Code: |
----+----1----+----2----+----3----+----4----+----5-
HEADER 20080424 IND
20080423CAN380638 I04/25/2008CAR70
20080423CAN322156 I04/25/2008CARF4
20080423CAN322726 I04/25/2008CARF4
20080423CDN829228 I04/25/2008CDAV4
20080423CDN321708 I04/25/2008CDAFF4
20080423CON317303 I04/25/2008CBAF4
20080423CON322834 I04/25/2008CBAF4 |
I want the output like below
header changed to BAN
CAN changed to CTN and CAR changed to CYR
CDN changed to CSR and CDA changed to CGT
CON cahnged to CXT and CBA changed to NMF
| Code: |
----+----1----+----2----+----3----+----4----+----5-
HEADER 20080424 BAN
20080423CTN380638 I04/25/2008CYR70
20080423CTN322156 I04/25/2008CYRF4
20080423CTN322726 I04/25/2008CARF4
20080423CSR829228 I04/25/2008CGTV4
20080423CSR321708 I04/25/2008CGTFF4
20080423CXT317303 I04/25/2008NMFF4
20080423CXT322834 I04/25/2008NMFF4 |
|
|
| Back to top |
|
 |
References
|
Posted: Wed May 07, 2008 5:08 pm Post subject: Re: Sort input File FB=200 |
 |
|
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1002 Location: At my desk
|
|
|
|
No sort?
FB is the recfm.
What it the 200, block size or record length?
Either way, what is the lrecl and blksize? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
It's not clear if you want to change CAN and CAR only if both appear in the record (if CAN and CAR appear in the record, change both) or independently (if CAN appears, change it. If CAR appears, change it). Assuming independence, here's a DFSORT job that will do what you asked for. If they're not independent, let me know.
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/200)
//SORTOUT DD DSN=... output file (FB/200)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(17:C'BAN'),HIT=NEXT),
IFTHEN=(WHEN=(9,3,CH,EQ,C'CAN'),
OVERLAY=(9:C'CTN'),HIT=NEXT),
IFTHEN=(WHEN=(31,3,CH,EQ,C'CAR'),
OVERLAY=(31:C'CYR'),HIT=NEXT),
IFTHEN=(WHEN=(9,3,CH,EQ,C'CDN'),
OVERLAY=(9:C'CSR'),HIT=NEXT),
IFTHEN=(WHEN=(31,3,CH,EQ,C'CDA'),
OVERLAY=(31:C'CGT'),HIT=NEXT),
IFTHEN=(WHEN=(9,3,CH,EQ,C'CON'),
OVERLAY=(9:C'CXT'),HIT=NEXT),
IFTHEN=(WHEN=(31,3,CH,EQ,C'CBA'),
OVERLAY=(31:C'NMF'))
/*
|
|
|
| Back to top |
|
 |
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 64 Location: INDIA
|
|
|
|
Frank,
I have coded the control card like this and its working fine.
| Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(17:C'BAN')),
IFTHEN=(WHEN=NONE,
OVERLAY=(1,8,9:9,3,CHANGE=(3,C'CAN',C'CTN',C'CDN',C'CSR',
C'CON',C'CXT'),NOMATCH=(9,3),12,19,
31:31,3,CHANGE=(3,C'CAR',C'CYR',C'CDA',C'CGT',
C'CBA',C'NMF'),NOMATCH=(31,3),34,166))
/* |
Please let me know if it is ineffiecient.
or the problems that can be occured by this card.
Regards
Amar |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
Amar,
Yes, that's another way to do it providing the fields are independent.
However, since you're using OVERLAY, you don't have to specify the fields you're NOT changing (that's kind of the point of OVERLAY). So your OVERLAY operand should be:
| Code: |
OVERLAY=(9:9,3,CHANGE=(3,C'CAN',C'CTN',C'CDN',C'CSR',
C'CON',C'CXT'),NOMATCH=(9,3),
31:31,3,CHANGE=(3,C'CAR',C'CYR',C'CDA',C'CGT',
C'CBA',C'NMF'),NOMATCH=(31,3)))
|
|
|
| Back to top |
|
 |
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 64 Location: INDIA
|
|
|
|
Great!!!
Thank you frank. I am clarified about overlay bit more.
Regards
Amar |
|
| Back to top |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 153 Location: Pune
|
|
|
|
Hi Frank,
There is slight change in the requirement as below, I am finding it difficult to control this type of complex requirement... Please help me out...
| Code: |
----+----1----+----2----+----3----+----4----+----5-
HEADER 20080424 IND
20080423CAN380638 C ABCDI04/25/2008CAR70
20080423CAN322156 C DFEEI04/25/2008CARF4
20080423CAN322726 C DFEEI04/25/2008CARF4
20080423CAN829228 C RRTTI04/25/2008CARV4
20080423CAN321708 C DFEEI04/25/2008CARFF4
20080423CAN317303 C DFETI04/25/2008CARF4
20080423CAN322834 C DFETI04/25/2008CARF4 |
As there is CAN CAR combination is there in all the records
I need the output as
Header change as IND to BAN
For first 3 Records change should happen as CTN and CYR
Next 2 records change should happen as CSR and CGT
Next 2 records change should happen as CXT and NMF
All C is changed to G except for the DFEE and DFET Records
And in the other Output I need the Number of combination changed from
CAN CAR to CTN and CYR
CAN CAR to CSR and CGT
CAN CAR to CXT and NMF
and Number of Records C changed to G
Record count may change every time, So there must be some sort of count in the control card where I can change it every time and Run
In this example Its 3, 2 and 2 it may be next time 4, 5, 6 ....
| Code: |
----+----1----+----2----+----3----+----4----+----5-
HEADER 20080424 BAN
20080423CTN380638 G ABCDI04/25/2008CYR70
20080423CTN322156 C DFEEI04/25/2008CYRF4
20080423CTN322726 C DFEEI04/25/2008CYRF4
20080423CSR829228 G RRTTI04/25/2008CGTV4
20080423CSR321708 C DFEEI04/25/2008CGTFF4
20080423CXT317303 C DFETI04/25/2008NMFF4
20080423CXT322834 C DFETI04/25/2008NMFF4 |
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will meet your new requirement. You just need to change the GP1END and GP2END values as the number of records in your groups change. So for example, for the 4,5,6 case, you would change GP1END to 5 and GP2END to 10 (remember to count the header record).
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
* Set GP1END +n value to relative record number of end of group 1
GP1END,+4
* Set GP2END +n value to relative record number of end of group 2
GP2END,+6
/*
//SORTIN DD DSN=... input file (FB/200)
//SORTOUT DD DSN=... output file (FB/200)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=200,
IFTHEN=(WHEN=INIT,OVERLAY=(201:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(17:C'BAN'),HIT=NEXT),
IFTHEN=(WHEN=(201,8,ZD,GE,+2,AND,21,4,SS,NE,C'DFEE,DFET'),
OVERLAY=(19:C'G'),HIT=NEXT),
IFTHEN=(WHEN=(201,8,ZD,GE,+2,AND,201,8,ZD,LE,GP1END),
OVERLAY=(9:C'CTN',36:C'CYR')),
IFTHEN=(WHEN=(201,8,ZD,GT,GP1END,AND,201,8,ZD,LE,GP2END),
OVERLAY=(9:C'CSR',36:C'CGT')),
IFTHEN=(WHEN=(201,8,ZD,GT,GP2END),
OVERLAY=(9:C'CXT',36:C'NMF'))
/*
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
| Quote: |
And in the other Output I need the Number of combination changed from
CAN CAR to CTN and CYR
CAN CAR to CSR and CGT
CAN CAR to CXT and NMF
and Number of Records C changed to G |
It's not clear to me what you're talking about here. Please explain more clearly what other Output you're referring to and what it should look like, what the input looks like, and what you mean by "CAN CAR to CTN and CYR", etc. |
|
| Back to top |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 153 Location: Pune
|
|
|
|
Hi Frank,
Above JCL is working fine for me.. Excellent logic DFSORT is having in it and you are master in it...
The first out file is as per my requirement
| Code: |
| //SORTOUT DD DSN=... output file (FB/200) |
The second output file is that I am talking about the changes got in the first output file by using the Input file
The number of records changed from CAN to CTN
and CAR to CYR
can I get the report in separate output file...
I think I am more clear now... |
|
| Back to top |
|
 |
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 64 Location: INDIA
|
|
|
|
No Not yet.
| Quote: |
The second output file is that I am talking about the changes got in the first output file by using the Input file
The number of records changed from CAN to CTN
and CAR to CYR
|
Means is that enough to get the cound of CAN to CTN and CAR to CYR.
You don't need the count of CAN to CSR and CAR to CGT ,
then CAN to CXT and CAR to NMF
then number of records that changed from 'C' to 'G'.
Please post all the counts you require in the another output file.
Regards
Amar. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
| Quote: |
| I think I am more clear now... |
It's not clear to me. Please start over for this requirement and give the complete details - example of input records and expected output records, "rules" for getting from input to output, etc. |
|
| Back to top |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 153 Location: Pune
|
|
|
|
Frank,
What erver the sort control card is given by you is going to do the sort and do the modification of the input file.
The selection of particular Record types will be in the sysout
For Example
in sysout it will be metioned as INREC 20 outrec 15
For particular record type CAN and CAR combination
I need the Record counts changed by the above control card in separate output file.... Is it clear now and is it possible... |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
| No, it's not clear. I need what I asked for in my previous post to understand what you're trying to do. |
|
| Back to top |
|
 |
|
|
|