Posted: Fri Jun 10, 2005 7:02 am Post subject: Replace field value in table for all occurance thru File-aid
Hi,
I have a file which has table with 15 occurances. One of the field in the table has junk value and need to replace those junk with spaces in all the occurance of the table.
Please let me know how this can be achieved thru Fileaid. _________________ Ganesh.B
I believe that "01" represents the starting position and "00" represents the EOF. I have tried this by changing the starting and ending position and that too works fine. But when I try to restrict the position as follows, I am getting the following error message.
DD01 DSN=FILE1 OPENED AS KSDS,
LRECL=1255,KEYLEN=17,NRECRDS=1,CINV=7680,MAXRBA=691200,V
DD01O DSN=FILE2 OPENED AS PS,
RECFM=F,LRECL=1255,BLKSIZE=1255,VOL=TSX330
$$DD01 COPY REPLALL=(286,2,C'10',C'20')
1...5...10...15...20...25...30
DATA EXCEEDS SCAN LENGTH IN REPLALL, CHECK DATA STARTING IN COLUMN 30
.....SKIPPING TO NEXT $$DD CARD
[code]
Checked and made sure that the field trying to replace is only of 2 bytes.
I have changed the control card as follows which is working fine.
Sorry for not posting my requirement clear. Let me try to make it here.
[code]
Table defined as 15 occurance with 2 fields.
XXXX-LCHANGE-OP-ID-1(1) (starting position - 284, length - 4)
YYYY-CREATED-OP-ID-1(1) (starting position - 288, length - 4)
[code]
It is possible to have both these variables holding the same value. i.e created & changed by same person. In this case, if I need to change ONLY the LCHANGE-OP-ID to "BBBB" if it is "AAAA" for all the 15 occurance, how can I acheive this thru FileAid. _________________ Ganesh.B
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Tue Jun 14, 2005 9:06 am Post subject:
Quote:
Did you get a chance to look at the other problem mentioned.
Ganesh,
The batch reference manual of file-aid will answer all your queries. You don't have to mention the length for fileaid control cards , you just need the start position of string. so remove the 3 which you coded for the length of the string.
Quote:
I have removed "OUT=0" and tried and could not see any difference. What will "OUT=0" do?
The OUT parameter controls the number of records that are written or printed before processing stops. OUT=0 means write out all the input records. The default is 250 records. However it seems that your shop has OUT=0 as default.
Thanks for your help.
Referred batch reference manual for the other problem mentioned.
Code:
Replace by Condition
REPL=(location,{length },[dupl]compare-data,[dupl]new-data)
{operator}
location: Starting location of the data to check and/or replace. Any actual or relative location can be used.
length: Length of the area to check. The value must be at least one byte longer than the compare-data length. Use 0 to scan until the end of the record.
DD01 DSN=FILE1 OPENED AS KSDS,
LRECL=1255,KEYLEN=17,NRECRDS=1,CINV=7680,MAXRBA=69120
DD01O DSN=FILE2 OPENED AS PS,
RECFM=F,LRECL=1255,BLKSIZE=1255,VOL=TSX014
$$DD01 COPY REPLALL=(286,,C'10',C'20')
1...5...10...15...20...25.
LENGTH NOT SPECIFIED FOR REPLALL, CHECK DATA STARTING IN COLUMN 26
.....SKIPPING TO NEXT $$DD CARD
DD01 DSN=FILE1 OPENED AS KSDS,
LRECL=1255,KEYLEN=17,NRECRDS=1,CINV=7680,MAXRBA=691200,
DD01O DSN=FILE2 OPENED AS PS,
RECFM=F,LRECL=1255,BLKSIZE=1255,VOL=TSX346
$$DD01 COPY REPL=(286,,C'10',C'20')
1...5...10...15...20...
INVALID LENGTH OR OPERATOR IN REPL, CHECK DATA STARTING IN COLUMN 23
.....SKIPPING TO NEXT $$DD CARD
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Wed Jun 15, 2005 8:20 am Post subject:
Ganesh,
*sigh* You have an extra comma after the start pos.
When you use REPLALL you need to specify length, as "ALL" is applicable to the entire lrecl.
When you use REPL the you are changing only one position. In that case you don't need the length ,but you do need a relational operator (EQ, NE, GT, LT...)
so change your control cards to the following.
Quote:
$$DD01 COPY REPL=(286,EQ,C'10',C'20')
The above control cards will replace the content at 286 to 20 if the value is 10.
Hope this helps...
Cheers
kolusu
Ps: Since you have the batch refence fileaid manual , I suggest that you spend sometime reading it. _________________ Kolusu
www.linkedin.com/in/kolusu
Thanks for all of your responses. I think we have edited the post to reply at same time.
Regarding the extra comma, I gave it as the length alone is given in curly brackets and hence thought that way.
Code:
Replace by Condition
REPL=(location,{length },[dupl]compare-data,[dupl]new-data)
{operator}
location: Starting location of the data to check and/or replace. Any actual or relative location can be used.
length: Length of the area to check. The value must be at least one byte longer than the compare-data length. Use 0 to scan until the end of the record.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum