posting.php?mode=reply&f=11&t=4898#preview.
Customization parameters can be supplied to batch programs through INPUT statements. The MODIFIED tag of these parameters can be tested, just like in on-line programs. Here's a sample batch program. It doesn't look any different than an on-line program.
DEFINE DATA LOCAL
1 #A (A1)
1 #B (A1)
1 #C (A1)
1 #CA (C)
1 #CB (C)
1 #CC (C)
1 #MA (A10)
1 #MB (A10)
1 #MC (A10)
END-DEFINE
REPEAT
INPUT (AD=MDT)
'A:' #A (CV=#CA)
/ 'B:' #B (CV=#CB)
/ 'C:' #C (CV=#CC)
IF #A = '.'
THEN
STOP
END-IF
RESET #MA #MB #MC
IF #CA MODIFIED
THEN
ASSIGN #MA = 'modified'
END-IF
IF #CB MODIFIED
THEN
ASSIGN #MB = 'modified'
END-IF
IF #CC MODIFIED
THEN
ASSIGN #MC = 'modified'
END-IF
WRITE '=' #A #MA
'=' #B #MB
'=' #C #MC
END-REPEAT
END
1 #A (A1)
1 #B (A1)
1 #C (A1)
1 #CA (C)
1 #CB (C)
1 #CC (C)
1 #MA (A10)
1 #MB (A10)
1 #MC (A10)
END-DEFINE
REPEAT
INPUT (AD=MDT)
'A:' #A (CV=#CA)
/ 'B:' #B (CV=#CB)
/ 'C:' #C (CV=#CC)
IF #A = '.'
THEN
STOP
END-IF
RESET #MA #MB #MC
IF #CA MODIFIED
THEN
ASSIGN #MA = 'modified'
END-IF
IF #CB MODIFIED
THEN
ASSIGN #MB = 'modified'
END-IF
IF #CC MODIFIED
THEN
ASSIGN #MC = 'modified'
END-IF
WRITE '=' #A #MA
'=' #B #MB
'=' #C #MC
END-REPEAT
END
Here are the input parameters.
//CMSYNIN DD *
%Q
R RGZCV
A,B,C
1,,3
,2
.
FIN
/*
//
%Q
R RGZCV
A,B,C
1,,3
,2
.
FIN
/*
//
And here's the output.
DATA A,B,C
Page 1
#A: A modified #B: B modified #C: C modified
DATA 1,,3
Page 2
#A: 1 modified #B: B #C: 3 modified
DATA ,2
Page 3
#A: 1 #B: 2 modified #C: 3
DATA .
NEXT FIN
NAT9995 Natural session terminated normally.
Page 1
#A: A modified #B: B modified #C: C modified
DATA 1,,3
Page 2
#A: 1 modified #B: B #C: 3 modified
DATA ,2
Page 3
#A: 1 #B: 2 modified #C: 3
DATA .
NEXT FIN
NAT9995 Natural session terminated normally.