How can you get the replace option on the as400 DBU to work?

385 pts.
Tags:
AS/400 commands
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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>

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Teandy
    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,860 pointsBadges:
    report
  • nitzinger
    The SQL solution is the real way to process a file. DBU doesn't want to work on my system.
    385 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following