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
 

 

To eliminate a part of a record after a particular word

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Nov 01, 2007 3:13 pm    Post subject: To eliminate a part of a record after a particular word
Reply with quote

Hi,

I have a sequential file with no copybook. In that I have to search for a string like 'CON'. My requirement is, I have to copy all the records of the i/p file to o/p file and if a record has the word 'CON', the data after the word 'CON' should not be copied to o/p file for that record alone.

Let me explain with a example.

consider records in the i/p file as follows.

abcdefg CON SIGHAL ABDCDEDD
aaaaaaaaa
bbbbbbbbb


The output should be

abcdefg CON
aaaaaaaaa
bbbbbbbbb

how can I do this in JCL through sort or File aid???

Thanks in advance,
Sakthi.
Back to top
View user's profile Send private message

hemanth.nandas

Active User


Joined: 18 Aug 2007
Posts: 120
Location: Chennai

PostPosted: Thu Nov 01, 2007 3:27 pm    Post subject:
Reply with quote

Hi Sakthi,

You can do it using DFSORT or COBOL Reference Modification.

I know COBOL Reference Modification. I will the code use that,

Code:
IF WS-INREC(9:3) = 'CON'
    MOVE WS-INREC(1:11) TO NEW-WS-INREC
    WRITE OUTREC FROM NEW-WS-INREC
ELSE
    WRITE OUTREC FROM WS-INREC
END-IF.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Nov 01, 2007 3:36 pm    Post subject:
Reply with quote

how can I do it fileaid or JCL (sort card).. I tried posting this question in JCL forum, but it got removed from that forum. COuld anyone please help me how can i accomplish this in JCL or Fileaid???

Thanks,
Sakthi.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 01, 2007 8:50 pm    Post subject:
Reply with quote

Hello Sakthi,

Which sort product does your system use? It will probably be DFSORT or Syncsort.

Your topic was moved due to the earlier reference to "sort". As you may have noticed, DFSORT questions have "their own" place in the forum. Syncsort questions are usually dealt with in the JCL section.

Depending on which sort you use and how you continue with this requirement, your topic may stay here or be relocated.
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 Nov 01, 2007 10:52 pm    Post subject:
Reply with quote

Sakthi,

You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN                                   
//SYSOUT    DD  SYSOUT=*                                   
//SORTIN DD *                                               
abcdefg CON SIGHAL ABDCDEDD                                 
aaaaaaaaa                                                   
bbbbbbbbb                                                   
xyz CON qrst                                               
xyz abc rst CON mnopqrst                                   
cc cccc   rrrr    qqq                                       
//SORTOUT DD SYSOUT=*                                       
//SYSIN    DD    *                                         
  OPTION COPY                                               
  INREC PARSE=(%01=(ENDAT=C'CON',FIXLEN=80)),               
    BUILD=(%01)                                             


SORTOUT would have:

Code:

abcdefg CON               
aaaaaaaaa                 
bbbbbbbbb                 
xyz CON                   
xyz abc rst CON           
cc cccc   rrrr    qqq     
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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