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 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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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