I have a VB data set:
in Position (28,3) : i have the lenght of the record that i would like to get * 14
that's to say : if i have the value 004 in position (28,3), i would like to get the record with a lenght of 14*4=56 like (31,56) and the first 20 characters.
here a code in REXX :
/* REXX */
/*TRACE I */
'EXECIO * DISKR ficin (STEM REC. FINIS'
DROPBUF 0
DO K=1 TO REC.0
NB_OCC=SUBSTR(REC.K,28,3)
SAY NB_OCC
NB_CARAC_TO_WRITE=30+(14*NB_OCC)
SAY NB_CARAC_TO_WRITE
DATA_LIGNE=""
DATA_LIGNE=SUBSTR(REC.K,1,NB_CARAC_TO_WRITE)
QUEUE DATA_LIGNE
END
'EXECIO * DISKW ficout (FINIS'
/*TRACE I */
'EXECIO * DISKR ficin (STEM REC. FINIS'
DROPBUF 0
DO K=1 TO REC.0
NB_OCC=SUBSTR(REC.K,28,3)
SAY NB_OCC
NB_CARAC_TO_WRITE=30+(14*NB_OCC)
SAY NB_CARAC_TO_WRITE
DATA_LIGNE=""
DATA_LIGNE=SUBSTR(REC.K,1,NB_CARAC_TO_WRITE)
QUEUE DATA_LIGNE
END
'EXECIO * DISKW ficout (FINIS'
Can we do that with a JCL step ?
Thank you for your help
Sorry for my english
Have a nice day