Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2276
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us