Hi... I am trying to write a Batch File Manager that looks at a value in the header record, then changes all other records based on that value. I would normally do this with a COBOL program or something, but I am trying to incorporate this into an existing Batch File Manager that is already written and does other things too. I am perfectly happy to look through manuals or google search to work through the details, but it would be very helpful if you could help me get started in the right direction. Thank you Very much for taking the time to help... Jeff.
I tried to use FCH to look at the header record then make a global change, but couldn't get it working...
the trouble was limitations of the Find command in Batch (no PREV or NX etc) and couldn't figure out how
to check the return code after the Find to see if the find was successful...
$$FILEM FCH INPUT=DD01
F ' ' 100 790
F 'ENV31' 22
C '0' '1' 1 122
I also tried this (not full code, but the important REXX varialbe and variable passing)
[Set Variable after reading the first record]
$$FILEM DSC INPUT=DD01,
$$FILEM OUTPUT=DD01O,
$$FILEM PROC=*
/* FASTREXX */
/* ?do something to interrigate a value in the first record? */
JKTYP = 7
ADDRESS ISPEXEC
'VPUT JKTYP SHARED'
EXIT;
[Then on all subsequent records... do something different for TYPE7 records]
[I also tried with ADDRESS ISPEXEC 'VGET JKTYP' but that caused the JOB to abend]
* FASTREXX */
IF JKTYP = 7 THEN DO
OUTREC = CHANGE(OUTREC,FLD(5,6),'777777',1,5,6)
END
EXIT;