Ananthalakshmi
New User
Joined: 14 Dec 2005 Posts: 2
|
|
|
|
Hi,
I want solution using FILEAID, for the following problem.
problem statement:
------------------------
I have an input PS file.
i need to copy that file to another PS file, but after replacing some data in the input file under specific condition( say for e.g., if the 5th position in a record has 'X' replace that by '#'). Also i want to display the details in the SPOOL ,on which all records got changed, or write the information about the changed records in a new PS file.I want to acheive all these using FILEAID.Kindly suggest a solution.
Thanks in Advance,
Ananthalakshmi |
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
Try this:
Code: |
//FILEAID EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=INPUT.FILE,DISP=OLD
//DD01O DD DSN=OUTPUT.FILE,UNIT=SYSDA,DISP=(NEW,CATLG),
// RECFM=??,LRECL=???,BLKSIZE=???,
// SPACE=(TRK,(100,50),RLSE)
//SYSIN DD *
$$DD01 CA IF=(5,EQ,C'X'),REPL=(5,C'#'),LIST=0
|
This FILEAID does a COPYALL (copies all records) to DD01O. If it finds a X in position 5 of a record, it replaces it with a #. The LIST=0 will print out all the changed records to the SYSLIST output DD statement. |
|