First time i am coding a REXX program. I build a panel. After pressing 3 times enter the program is completing. I need help to fix this issue.
Input to the panel is High level qualifiers( firsrt,second..) and email id. expected ouput is create a new dataset and update the dataset with High level qualifiers info( ex A.B.C..) and other dataset Email id should be overriden. In my input file 3 rd line and 5th line is having email id. So i am overriding that email id with new email id whih i am giving in panel. Please find my code below. I put a trace also. after exectuing "EXECIO * DISKW UPDATED(FINIS" instruction onlt it's struking. After pressing enter again it's continueing execution.
PANEL:
)ATTR DEFAULT(%+_)
@ TYPE(TEXT) SKIP(ON) INTENS(LOW)
% TYPE(TEXT) INTENS(HIGH)
+ TYPE(TEXT) INTENS(LOW)
_ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)
)BODY
+ EXTRACTION OF DATASET STATISTICS
+ --------------------------------------------------
+
+
+
+ %ENTER YOUR FIRST LEVEL QUALIFIER ==>_HQNAME1 @
+
+ %ENTER YOUR SECOND LEVEL QUALIFIER ==>_HQNAME2 @
+
+ %ENTER YOUR THIRD LEVEL QUALIFIER ==>_HQNAME3 @
+
+ %ENTER YOUR FOURTH LEVEL QUALIFIER ==>_HQNAME4 @
+
+ %ENTER YOUR FIFTH LEVEL QUALIFIER ==>_HQNAME5 @
+
+
+
+
+ %EMAIL : ENTER EMAIL ID ==>_MAILID @
+
+
+
+ %NOTE : 1.FIRST LEVEL QUALIFIER AND EMAIL ID ARE MANDATORY
+
+ %2.ENTER EIGHT CHARATERS MAXIMUM IN QUALIFIER FEILD
+
+
+
+ +PRESS ENTER TO CONTINUE,PF3 TO EXIT +
+
)INIT
)PROC
VER (&HQNAME1,NB,DSNAMEF)
VER (&HQNAME2,DSNAMEF)
VER (&HQNAME3,DSNAMEF)
VER (&HQNAME4,DSNAMEF)
VER (&HQNAME5,DSNAMEF)
VER (&MAILID,MIX)
)END
)ATTR DEFAULT(%+_)
@ TYPE(TEXT) SKIP(ON) INTENS(LOW)
% TYPE(TEXT) INTENS(HIGH)
+ TYPE(TEXT) INTENS(LOW)
_ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)
)BODY
+ EXTRACTION OF DATASET STATISTICS
+ --------------------------------------------------
+
+
+
+ %ENTER YOUR FIRST LEVEL QUALIFIER ==>_HQNAME1 @
+
+ %ENTER YOUR SECOND LEVEL QUALIFIER ==>_HQNAME2 @
+
+ %ENTER YOUR THIRD LEVEL QUALIFIER ==>_HQNAME3 @
+
+ %ENTER YOUR FOURTH LEVEL QUALIFIER ==>_HQNAME4 @
+
+ %ENTER YOUR FIFTH LEVEL QUALIFIER ==>_HQNAME5 @
+
+
+
+
+ %EMAIL : ENTER EMAIL ID ==>_MAILID @
+
+
+
+ %NOTE : 1.FIRST LEVEL QUALIFIER AND EMAIL ID ARE MANDATORY
+
+ %2.ENTER EIGHT CHARATERS MAXIMUM IN QUALIFIER FEILD
+
+
+
+ +PRESS ENTER TO CONTINUE,PF3 TO EXIT +
+
)INIT
)PROC
VER (&HQNAME1,NB,DSNAMEF)
VER (&HQNAME2,DSNAMEF)
VER (&HQNAME3,DSNAMEF)
VER (&HQNAME4,DSNAMEF)
VER (&HQNAME5,DSNAMEF)
VER (&MAILID,MIX)
)END
REXX PROGRAM:
/*REXX*/
"ISPEXEC LIBDEF ISPPLIB DATASET ID('TSO78DX.BTCHMGMT.PANEL')"
"ISPEXEC DISPLAY PANEL(HLQPAN2)"
/*TRACE("R")*/
IF RC ¬= 0 THEN DO
SAY 'COMMAND CANCELLED'
EXIT
END
ELSE
TRACE('R')
X=HLNAME1
FLAG=0
IF (HQNAME1 <> ' ' & HQNAME2 = ' ' & HQNAME3 = ' ' & HQNAME4 = ' ',
&HQNAME5 = ' ')
THEN
FLAG=1
IF (HQNAME2 <> ' ' & HQNAME3 = ' ' & HQNAME4 = ' ' & HQNAME5 = ' ')
THEN
FLAG=2
IF (HQNAME3 <> ' ' & HQNAME4 = ' ' & HQNAME5 = ' '& HQNAME2 <> ' ')
THEN
FLAG=3
IF (HQNAME4 <> ' ' & HQNAME5 = ' ')
THEN
FLAG=4
IF (HQNAME5 <> ' ')
THEN
FLAG=5
SELECT;
WHEN FLAG=1
THEN X=HQNAME1
WHEN FLAG=2
THEN X=HQNAME1||'.'||HQNAME2
WHEN FLAG=3
THEN X=HQNAME1||'.'||HQNAME2||'.'||HQNAME3
WHEN FLAG=4
THEN X=HQNAME1||'.'||HQNAME2||'.'||HQNAME3||'.'||HQNAME4
WHEN FLAG=5
THEN X=HQNAME1||'.'||HQNAME2||'.'||HQNAME3||'.'||HQNAME4||'.'||HQNAME5
OTHERWISE SAY '''HLQS NOT ENTERED CORRECTLY- ENTER IN ORDER'
EXIT
END
"ALLOCATE DATASET('TSO78DX.PANEL.TEST08'),
NEW RECFM(F B) LRECL(80) BLKSIZE(8000) TRACKS SPACE(1,1) DSORG(PS)"
"ALLOC DA('TSO78DX.PANEL.TEST08') F(UPDATEDD) OLD"
"EXECIO 0 DISKRU UPDATEDD 0"
/*PULL LINE*/
PUSH X
"EXECIO * DISKW UPDATEDD(FINIS"
"FREE F(UPDATEDD)"
"ALLOC DA('TSO78DX.PANEL.TEST02') F(UPDATED) OLD"
"EXECIO * DISKRU UPDATED ( FINIS STEM ARR."
I1 = 5
I2 = 3
DO I = ARR.0 BY -1 TO 1
ARR.I1= 'TO: <'||MAILID||'>'
ARR.I2='RCPT TO: <'||MAILID||'>'
PUSH ARR.I
END
"EXECIO * DISKW UPDATED(FINIS"
"FREE F(UPDATEDD)"
"ISPEXEC LIBDEF ISPPLIB DATASET ID('TSO78DX.BTCHMGMT.PANEL')"
"ISPEXEC DISPLAY PANEL(HLQPAN2)"
/*TRACE("R")*/
IF RC ¬= 0 THEN DO
SAY 'COMMAND CANCELLED'
EXIT
END
ELSE
TRACE('R')
X=HLNAME1
FLAG=0
IF (HQNAME1 <> ' ' & HQNAME2 = ' ' & HQNAME3 = ' ' & HQNAME4 = ' ',
&HQNAME5 = ' ')
THEN
FLAG=1
IF (HQNAME2 <> ' ' & HQNAME3 = ' ' & HQNAME4 = ' ' & HQNAME5 = ' ')
THEN
FLAG=2
IF (HQNAME3 <> ' ' & HQNAME4 = ' ' & HQNAME5 = ' '& HQNAME2 <> ' ')
THEN
FLAG=3
IF (HQNAME4 <> ' ' & HQNAME5 = ' ')
THEN
FLAG=4
IF (HQNAME5 <> ' ')
THEN
FLAG=5
SELECT;
WHEN FLAG=1
THEN X=HQNAME1
WHEN FLAG=2
THEN X=HQNAME1||'.'||HQNAME2
WHEN FLAG=3
THEN X=HQNAME1||'.'||HQNAME2||'.'||HQNAME3
WHEN FLAG=4
THEN X=HQNAME1||'.'||HQNAME2||'.'||HQNAME3||'.'||HQNAME4
WHEN FLAG=5
THEN X=HQNAME1||'.'||HQNAME2||'.'||HQNAME3||'.'||HQNAME4||'.'||HQNAME5
OTHERWISE SAY '''HLQS NOT ENTERED CORRECTLY- ENTER IN ORDER'
EXIT
END
"ALLOCATE DATASET('TSO78DX.PANEL.TEST08'),
NEW RECFM(F B) LRECL(80) BLKSIZE(8000) TRACKS SPACE(1,1) DSORG(PS)"
"ALLOC DA('TSO78DX.PANEL.TEST08') F(UPDATEDD) OLD"
"EXECIO 0 DISKRU UPDATEDD 0"
/*PULL LINE*/
PUSH X
"EXECIO * DISKW UPDATEDD(FINIS"
"FREE F(UPDATEDD)"
"ALLOC DA('TSO78DX.PANEL.TEST02') F(UPDATED) OLD"
"EXECIO * DISKRU UPDATED ( FINIS STEM ARR."
I1 = 5
I2 = 3
DO I = ARR.0 BY -1 TO 1
ARR.I1= 'TO: <'||MAILID||'>'
ARR.I2='RCPT TO: <'||MAILID||'>'
PUSH ARR.I
END
"EXECIO * DISKW UPDATED(FINIS"
"FREE F(UPDATEDD)"