Overlay using FILEAID.

Compuware's data management products: File-AID for IMS, File-AID/MVS, File-AID for DB2 and DBA-XPERT for DB2
mj025
Posts: 11
Joined: Fri Jun 13, 2014 2:29 pm
Skillset: cobol,jcl,db2,vsam.
Referer: internet

Overlay using FILEAID.

Postby mj025 » Thu Jul 03, 2014 3:15 pm

Hi all,
I am new to here this is my first post in the forum :) .
I have input ESDS which is VB file in which certain fields should be masked with spaces........
So, how i can do this using FILE AID or any other utility
let starting position may be 10 and length is 15 of that field that should be masked.....!!

Ed Goodman
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Skillset: 30 years on IBM mainframes
Referer: Searched for Frank Yeager

Re: Overlay using FILEAID.

Postby Ed Goodman » Thu Jul 03, 2014 5:45 pm

From my manual:

Replace by Location
The syntax of the REPL parameter when used to unconditionally replace data in a given location is:
REPL=(location,[dupl]new-data)
location : Starting location of the data to replace. Any valid actual or relative location can be used.
dupl : Optional duplication factor that defines the number of times File-AID repeats the new-data, starting at the specified location.
new-data : New data to place in the specified location. Any data format may be entered.

Example 1:

Code: Select all

$$DD01 COPY REPL=(4,C’6’)

Example 1 copies the input dataset and replaces the data in location 4 of each record
with a character 6.

mj025
Posts: 11
Joined: Fri Jun 13, 2014 2:29 pm
Skillset: cobol,jcl,db2,vsam.
Referer: internet

Re: Overlay using FILEAID.

Postby mj025 » Fri Jul 04, 2014 10:38 am

Hi Ed Goodman,

thanx for your reply,i have a idea about the Replace in fileaid but i don't know the correct syntax.
REPL = (4,10C' ')
does the above code will work if i want 10 spaces from 4th position onwards.......?
anyways i will try this. :)

mj025
Posts: 11
Joined: Fri Jun 13, 2014 2:29 pm
Skillset: cobol,jcl,db2,vsam.
Referer: internet

Re: Overlay using FILEAID.

Postby mj025 » Fri Jul 04, 2014 4:24 pm

Hi,
The above code worked for me but if i have to replace more than one fields than how i have to code
like in SORT we code OVERLAY = (1:12C' ' ,23:12C' '...... ) the same with REPL in file aid......?

Ed Goodman
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Skillset: 30 years on IBM mainframes
Referer: Searched for Frank Yeager

Re: Overlay using FILEAID.

Postby Ed Goodman » Mon Jul 07, 2014 6:05 pm

Try REPL=(),REPL=(),

Seriously, set up some small test datasets and try things. You'll learn more.

Also, get yourself a copy of the manual, which IS available, no matter what you think.

mj025
Posts: 11
Joined: Fri Jun 13, 2014 2:29 pm
Skillset: cobol,jcl,db2,vsam.
Referer: internet

Re: Overlay using FILEAID.

Postby mj025 » Tue Jul 08, 2014 2:58 pm

Hi Ed Godman,
thanx for ur reply,
Ya i tried it earlier before ur post as the same u said using some sample datasets and i got the output as required but i forgotted to reply back here my fault.
thanx for ur concern and time.

Ed Goodman
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Skillset: 30 years on IBM mainframes
Referer: Searched for Frank Yeager

Re: Overlay using FILEAID.

Postby Ed Goodman » Tue Jul 08, 2014 5:40 pm

awesome!

Please post your working code for the next poor programmer trying to make it work.

mj025
Posts: 11
Joined: Fri Jun 13, 2014 2:29 pm
Skillset: cobol,jcl,db2,vsam.
Referer: internet

Re: Overlay using FILEAID.

Postby mj025 » Wed Jul 09, 2014 11:15 am

Hi,
The code which worked for me is...
$$DD01 COPY IF=(5,EQ,C'A'),
REPL=(5,C'1'),REPL=(6,C'2'),
REPL=(7,C' ') ,REPL=(8,C'2')

Ed Goodman
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Skillset: 30 years on IBM mainframes
Referer: Searched for Frank Yeager

Re: Overlay using FILEAID.

Postby Ed Goodman » Thu Jul 10, 2014 6:06 pm

That's good that it worked.

I think, since the fields you showed were contiguous, that you could have used REPL=(5,C'A12 2').

(You actually posted with two replaces going to column 5, so not exactly sure)


  • Similar Topics
    Replies
    Views
    Last post