Hi All,
This is my requirement. My input dataset contains the below format. i want to do validations on my decimal field(column 13 to column 18). After that
i will move the valid records into the output dataset.
Conditions:
1) first digit should be '0'
2) last digit should be 'C' --> as it is decimal field.
3) There should be only interger value(0 to 9) from column 13 to column 18
Ex for valid record: 2nd record
0001400046
invalid record: 1st record
00014A00038 --> 'A' should not be present here. so we need to omit this record.There should be only interger value(0 to 9) from column 13 to column 18.........
input dataset format:
12345678901234567890123 ----> Column no
0004 ¢ ð03210
4444FFFF4444004008FFFFF
00000004000001A03C03210
-----------------------
0004 %03210
4444FFFF4444004006FFFFF
00000004000001004C03210
-----------------------
0004 <03210
4444FFFF4444004004FFFFF
00000004000001005C03210
output dataset:(1st record should be omitted as it contains invaid decimal vaue)
0004 %03210
4444FFFF4444004006FFFFF
00000004000001004C03210
-----------------------
0004 <03210
4444FFFF4444004004FFFFF
00000004000001005C03210
Program skeleton:
"EXECIO * DISKR INFIL (STEM INF. FINIS)"
DO I = 1 TO INF.0
if (decimal_field(last char))='C' then
do
validate other_fields
if matches then
COPY RECS INTO OUTFILE(OUTPUT FILE)
ELSE
LEAVE THIS RECORD
end
END
Can anyone please suggest me to code the REXX PROGRAM for the above skeleton ?