IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to remove Multiple Noations from a particualr field


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Tue Feb 10, 2009 11:18 am
Reply with quote

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
Code:
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Feb 10, 2009 12:50 pm
Reply with quote

gopinathmk,

What are the possible values for first notation of '001' records?
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Tue Feb 10, 2009 1:12 pm
Reply with quote

Arun,

We may have upto 10 Notations based on different conditions.

Gopi
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 10, 2009 10:24 pm
Reply with quote

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
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Thu Feb 12, 2009 5:29 pm
Reply with quote

frank,

I just want to remove only if notation is NEW EMPLOYEE in the notation field.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Feb 12, 2009 10:51 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top