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 replace characters from a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
induajayrose
Warnings : 2

New User


Joined: 25 Jul 2005
Posts: 28
Location: Thrissur

PostPosted: Tue Nov 21, 2006 2:25 pm    Post subject: How to replace characters from a file
Reply with quote

Hi...

Consider I have a file whose record length is 200.Now I want an output file with its first 100 characters replaced with * .Can any suggest a method.

regards,
Indu
Back to top
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Nov 21, 2006 3:58 pm    Post subject: Re: How to replace characters from a file
Reply with quote

Hi Indu,
Apply Boundries from 1st colums to the 100th column.

Apply the following commands,

BNDS 1 100
C ALL P'=' '*'

Note: If you don't apply boundries, u are going to replace the whole file with '*'s.

~Vamsi
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Nov 21, 2006 5:48 pm    Post subject:
Reply with quote

Even shorter: C ALL P'?' '*' 1 100

O.
Back to top
View user's profile Send private message
rajrohith

New User


Joined: 15 Apr 2005
Posts: 54
Location: chennai

PostPosted: Tue Nov 21, 2006 11:25 pm    Post subject: How to replace characters from a file
Reply with quote

hai
can u give examples
where have to give this command
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed Nov 22, 2006 3:18 am    Post subject: Re: How to replace characters from a file
Reply with quote

Quote:
where have to give this command

Open your dataset in EDIT mode and at COMMAND Prompt type these commands one after one and hit ENTER... as you may not find "?" on your keyboard.
Code:
Command ===> BNDS 1 100                                       Scroll ===> CSR 
****** ***************************** Top of Data ******************************
Code:
Command ===> C ALL P'=' '*'                                   Scroll ===> CSR 
****** ***************************** Top of Data ******************************
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Wed Nov 22, 2006 4:03 am    Post subject: Re: How to replace characters from a file
Reply with quote

Can use this step if want to do the same in batch.
Code:
//STPU0000  EXEC PGM=ICEMAN                             
//SYSOUT    DD   SYSOUT=*                               
//SORTIN    DD   DSN=MY.INPUT.DATA <-----LENGHT 200,FB 
//SORTOUT   DD   DSN=MY.OUTPUT.DATA <----LENGHT 200,FB 
//SYSIN     DD *                                       
  OPTION COPY                                           
  OUTREC FIELDS=(100C'*',101,100)   



David P.
Back to top
View user's profile Send private message
kavitha81

New User


Joined: 21 Nov 2006
Posts: 6
Location: bangalore

PostPosted: Wed Nov 22, 2006 10:51 am    Post subject: Re: How to replace characters from a file
Reply with quote

OUTREC FIELDS=(100C'*',101,100)

Can you specify what this 101,100 means...

regards,
Kavitha
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Nov 22, 2006 11:28 am    Post subject:
Reply with quote

Hi Kavitha,

Quote:
OUTREC FIELDS=(100C'*',101,100)

Can you specify what this 101,100 means...


Here In o/p file we want to put * from 1 to 100 bytes & bytes starting from 101 & offset 100( means till 200th byte) we want to copy same as i/p file.

Eg:

i/p file
Code:
bytes 12345............100101102..........................200
      aaaaaaaaaaaaaaaaaa    b  b                              b


o/p File
Code:
bytes 12345............100101102..........................200
      *****************    b  b                              b
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 3 Sat Oct 14, 2017 2:29 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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