I am trying to allocate mutilple datasets through a loop. however after i allocate 1st dataset, i am unable to allocate the 2nd dataset.
The 1st dataset is correctly allocated. the 2nd dataset when try to allocate fails with RC 12
The 2nd dataset when tried seperately is getting allocated.
here is my piece of code where i am reading a file and allcating a dataset based on file content through a loop
DO WHILE EOF = 'NO'
"EXECIO 1 DISKR PARMS"
IF RC = 2 THEN
EOF = 'YES'
PARSE PULL in_rec
parms_read = parms_read+1
membr = (STRIP(SUBSTR(in_rec,01,8)))
call_retcode = 0
schd_dsn = user||'.T.CSP.Q.'||membr
dsnfnd = LISTDSI("'"schd_dsn"'") /* If data set already exist, */
/* delete it. */
IF sysreason = 0 THEN DO
"ALLOC FI(OUTFILE) NEW SP(5 5) TR DSORG(PS) RECFM(F B)
SAY 'RETURN CODE '||RC
SAY 'REASON CODE '||sysreason
IF RC \= 0 THEN DO
SAY ' E Error allocating '||schd_dsn
/* SIGNAL ERROR */
I am not able to get the issue behind alloication.