385 pts.
 How can you get the replace option on the as400 DBU to work?
I needed to massage a file to change a field from 1 to 001. It would of been an easy excersise if I could of got the replace option of as400 DBU application to work. The online instructions have a large amount of intell about how to search but nothing I could find about the replace utility. thanks

Software/Hardware used:
ASKED: December 14, 2009  9:22 PM
UPDATED: December 14, 2009  11:05 PM

Answer Wiki:
Dbu the file you want to change. Press F15 (Shift F3). Under the Replace section, put the name of the field you want to change and its new value. Further down you will see an option for how many occurrences to process. Put a 2 there to process all occurrences in the file. The last line will ask you how many records you want to search. I generally fill this line with 9's. See example below: <pre> Define Search/Replace Type choices, press Enter. A/O: A=AND O=OR Format... BLKSHIPTO Operation: GT LT EQ GE LE NE NG NL CT NC Value: Field, Number, 'Characters' or X'HEX' Search... Field Name A/O *RCD *RRN From To Op Value, *DECERR or *NULL More... Replace.. Field Name From To Value or *DELETE MYFIELD 001 More... Create subset of records . N Y=Yes, N=No Include deleted records . N Y=Yes, N=No Output results to file . . N Y=Yes, N=No Occurrences to process . . 2 1=Next, 2=All, 3=Previous Kind of match . . . . . . 1 1=Same case, 2=Ignore case Print results . . . . . . N Y=Yes, N=No Records to Search. . 999999999 & Progress Messages every 1000 records F3=Exit F4=Fields F9=Toggle SQL/SEARCH F16=Search F21=Submit to Batch </pre>
Last Wiki Answer Submitted:  December 14, 2009  10:05 pm  by  Teandy   5,830 pts.
All Answer Wiki Contributors:  Teandy   5,830 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If you still can not get the above to work, you can still do this with a simple SQL statement.

On the command line, key STRSQL and press enter. Then enter in something like the following:

UPDATE MYLIB/MEFILE SET MYFIELD = 001

Press enter and the file should be changed.

You may want to make a back up copy of the file prior to making any changes.

 5,830 pts.

 

The SQL solution is the real way to process a file. DBU doesn’t want to work on my system.

 385 pts.