Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to remove Multiple Noations from a particualr field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to remove Multiple Noations from a particualr field
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: 2353
Location: @my desk

PostPosted: Tue Feb 10, 2009 12:50 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Feb 10, 2009 10:24 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Feb 12, 2009 10:51 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am
No new posts Using multiple routines at exit 6 in ... Randy Horowitz All Other Mainframe Topics 2 Sat Feb 10, 2018 11:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us