I have 1 rd in my flat file.
say reord from 1 to 10 position : 'AS400NDB2400'
I need to change the value from N to Y
using SQL stmt ...How can I update this....?
Answers were Sorted based on User's Feedback
Answer / sachin
Try using this stmt :-
UPDATE TT SET TT = SUBSTR(TT,1,6) || 'Y' || substr(tt,8,6)
Cheers...
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / brave
Update <Table> set <field> = Substr(<field>,1,5)
||'Y'||Substr(<field>,7,6) where <Condition>
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / surya siram
UPDATE FF SET SUBSTR(RCD, 6, 1) = 'Y' WHERE SUBSTR(RCD, 6, 1) = 'N'
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mahalakshmi
update file1 set file1 = 'AS400YDB2400' where file1 = 'AS400NDB2400'
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / murali
Update <FileName> set substr(<Field Name>,6,1) = 'Y' where
substr(<Field Name>,6,1) = 'N'
| Is This Answer Correct ? | 0 Yes | 2 No |
what is the maximum number of subroutines allowed in rpg?
Diff B/w ref and reffld?
what do we can do with the embedded sql statements?
what is the length of a variable in rpg?
can a single screen format occupy a screen area above and below a subfile format ?
which are the string manipulation opcodes?
what is elastic and non elastic subrile?
What is field reference file?
what are the important factors in error message subfile ?
what is the difference between clear and reset opcodes and open and close opcodes?please tell me in real time senario with example please? And What is the use of SFLNXTCHG?Where we can use this?
I have created a command that display Source file and library. Now i want that when i enter library name and press f4 on Source file, pgm should display all the PF- SRC's in that Library. For F4 option i have used Choice program but since only limited paramters are passed in Choice pgm i am not able to paas library name and further can't call a pgm that will display list of Source files. Below is the Code snippet for CMD type object :- CMD PROMPT('Source Scan for HUB Standard') PARM KWD(SOURCE) TYPE(*CHAR) LEN(1) RSTD(*YES) + VALUES(N A) MIN(1) + CHOICE('N,A') PARM KWD(SRCFILE) TYPE(FILE) RSTD(*NO) + PROMPT('SOURCE FILE') FILE: QUAL TYPE(*NAME) LEN(10) RSTD(*NO) EXPR (*YES) + CHOICE(*PGM) + CHOICEPGM (XXXXXLIB/YYYPGM) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL)) EXPR(*YES) PROMPT ('Library') Below is the Choice pgm:- PGM PARM(&PARM1 &PARM2) DCL VAR(&PARM1) TYPE(*CHAR) LEN (21) DCL VAR(&PARM2) TYPE(*CHAR) LEN (2000) IF COND(%SST(&PARM1 1 10) = 'CHOICE ' *AND + %SST(&PARM1 11 10) = 'SRCFILE ' *AND + (%SST(&PARM1 21 1) = 'C' *OR %SST (&PARM1 + 21 1) = 'P')) THEN (DO) /* (%SST(&PARM1 21 1) = 'C' *OR %SST (&PARM1 + */ CHGVAR VAR(&PARM2) VALUE('Name, F4 for List') ENDDO IF COND(%SST(&PARM1 1 10) = 'CHOICE ' *AND + %SST(&PARM1 11 10) = 'SRCFILE ' *AND + %SST(&PARM1 21 1) = 'P') THEN (DO) CHGVAR VAR(&PARM2) VALUE('Name, F4 for List') CALL PGM(GTSQL) PARM ('XXXXLIB') return ENDDO Thanks in Advance for looking into.
Q. 1.What would be structure of CL PGM. 2. What are the levels of CL PGM. 3.How many files can be defined in new CLLE program?