muffirulz
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
Hi,
I have the following file
Code: |
----+----1----+----2----+----3-
*******************************
3040650901999-09-100001-01-01EE
7843304161999-08-020001-01-01EE
9586873901997-04-011998-07-15EE
3039913041998-12-030001-01-01EE
9302545841997-11-180001-01-01EE
0651718242001-06-010001-01-01EE
7009131401999-11-220001-01-01EE
9220380522000-05-012009-06-30RT
9220380522000-05-010001-01-01RT
9220380522000-05-010001-01-01RT
|
The o/p needs to be as follows
Code: |
----+----1----+----2----+----3-
*******************************
3040650901999-09-10 N
7843304161999-08-02 N
9586873901997-04-011998-07-15N
3039913041998-12-03 N
9302545841997-11-18 N
0651718242001-06-01 N
7009131401999-11-22 N
9220380522000-05-012009-06-30Y
9220380522000-05-01 Y
9220380522000-05-01 Y
|
Basically need to change the '0001-01-01' to spaces and
'RT' to Y and anything other than RT to N.
Please can someone help me on this. I tried using overlay but seems that it doesn't work for two fields on the same record.
Thnx
M |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
muffirulz,
The following DFSORT/ICETOOL JCl will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
3040650901999-09-100001-01-01EE
7843304161999-08-020001-01-01EE
9586873901997-04-011998-07-15EE
3039913041998-12-030001-01-01EE
9302545841997-11-180001-01-01EE
0651718242001-06-010001-01-01EE
7009131401999-11-220001-01-01EE
9220380522000-05-012009-06-30RT
9220380522000-05-010001-01-01RT
9220380522000-05-010001-01-01RT
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(20,10,CH,EQ,C'0001-01-01'),
OVERLAY=(20:10X),HIT=NEXT),
IFTHEN=(WHEN=(30,02,CH,NE,C'RT'),OVERLAY=(30:C'N '),HIT=NEXT),
IFTHEN=(WHEN=(30,02,CH,EQ,C'RT'),OVERLAY=(30:C'Y '))
/* |
|
|