View previous topic :: View next topic
|
Author |
Message |
gopinathmk
New User
Joined: 17 Nov 2006 Posts: 15
|
|
|
|
I have a File of LRECL 80 and having following Fields
NAME AGE DEPTNO NOTATION
Each record will be having a multiple notations in notation field.
For Ex:
Code: |
NAME AGE DEPTNO NOTATION
ABC 25 001 NEW EMPLOYEE
DEF 20 002 OLD EMPLOYEE
XYZ 23 001 NEW EMPLOYEE,REHIRE
PQR 25 003 NEW EMPLOYEE
|
I want to remove only noation NEW EMPLOYEE if associate is in DEPT NO 001.
For Ex Output Should be:
Code: |
NAME AGE DEPTNO NOTATION
ABC 25 001
DEF 20 002 OLD EMPLOYEE
XYZ 23 001 REHIRE
PQR 25 003 NEW EMPLOYEE
|
That is for the associate in DEPT NO 001 I dont want first Notation but I need to retain second one.
Length Of Each Field:
Code: |
NAME : 10
AGE : 02
DEPTNO :03
NOATION: 50 |
Please let me know how Can I do it in JCL
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
gopinathmk,
What are the possible values for first notation of '001' records? |
|
Back to top |
|
|
gopinathmk
New User
Joined: 17 Nov 2006 Posts: 15
|
|
|
|
Arun,
We may have upto 10 Notations based on different conditions.
Gopi |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
For dept 001, do you want to remove the first notation whatever it is, or do you just want to remove the first notation if its NEW EMPLOYEE?
For example, if the input record is:
Code: |
XYZ 23001OLD EMPLOYEE,REHIRE
|
what do you want for the output record? |
|
Back to top |
|
|
gopinathmk
New User
Joined: 17 Nov 2006 Posts: 15
|
|
|
|
frank,
I just want to remove only if notation is NEW EMPLOYEE in the notation field. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC 25001NEW EMPLOYEE
DEF 20002OLD EMPLOYEE
XYZ 23001NEW EMPLOYEE,REHIRE
PQR 25003NEW EMPLOYEE
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(13,3,CH,EQ,C'001',AND,
16,12,CH,EQ,C'NEW EMPLOYEE'),
BUILD=(1,15,16:29,52))
/*
|
SORTOUT will have:
Code: |
ABC 25001
DEF 20002OLD EMPLOYEE
XYZ 23001REHIRE
PQR 25003NEW EMPLOYEE
|
|
|
Back to top |
|
|
|