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: 2285
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

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