enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
instead of complicating things with makebuf and friends
would' t have been faster to ...
odataow.0 = 1
odataow.1 = "VFY APP OWNER AREA CRITICA CELL"
and forget about MAKEBUF, QUEUE, EXECIO QUEUED, DROPBUF
and why the useless assignment to appowner ?
the useless complication makes the script more difficult to understand |
|
italo_pm
New User
Joined: 26 Mar 2015 Posts: 37 Location: Italy
|
|
|
|
hi, thanks for answer,
you are right Enrico, i'm change a rexx code
- delete MAKEBUF, QUEUED, DROPBUF
- add
odataow.0 = 1
odataow.1 = "VFY APP OWNER AREA CRITICA CELL"
- and delete assignment appowner var...
- add idatainf to record from data (information) member...
- and in diskw write 2 var (odataow, odatainf) in one output
Address TSO "execio "odataow.0" diskw oddow (stem odataow."
Address TSO "execio "odatainf.0" diskw oddow (stem odatainf. finis "
the rexx
Code: |
/* REXX */
/*-----------------------------------------------------------------------------------------------*/
/*- start - */
/*- add record block: -*/
/* VFY APP RESPONSABILE AREA CRITICA CELL
*/
/*- add info owner: (NEW DATA: member INPOWNER) include = "VFY"
*/
/*- add info data: (not data change, only add for each member - exclude /= "VFY"
*/
/*-----------------------------------------------------------------------------------------------*/
/* input / output
*/
ipds = "MYLIB.SCRIPT.TEXT.INPUT"
opds = "MYLIB.SCRIPT.TEXT.OUTPUT"
/* list members
*/
z = outtrap('mbrs.')
Address TSO "LISTDS '"ipds"' MEMBERS"
z = outtrap(off)
/* skip the first useless lines of LISTDS
*/
do m = 7 to mbrs.0
/* odataow.0 = 0 */
odataow.0 = 1
odataow.1 = "VFY APP RESPONSABILE AREA CRITICA CELL"
mbr = strip(mbrs.m)
/*- add info owner: (NEW DATA: member INPOWNER) */
Address TSO "alloc file(iddow) dsname('"ipds"("INPOWNER")' ) shr"
if rc /= 0 then do
say "alloc error("rc") for dataset'"ipds"("INPOWNER")' "
iterate m
end
Address TSO "execio * diskr iddow (stem idataow. finis"
if rc /= 0 then do
say "EXECIO error("rc") for dataset'"ipds"("INPOWNER")' "
iterate m
end
/*- add info owner: (NEW DATA: member INPOWNER) */
do i=1 to idataow.0
if translate(left(idataow.i,12)) = "VFY" mbr then do
oow = odataow.0+1
odataow.oow = idataow.i
odataow.0 = oow
end
end
/*------------------------------------------------*/
/* list members
*/
/*- add info data for each member: (not data change) */
odatainf.0 = 0
Address TSO "alloc file(idd) dsname('"ipds"("mbr")' ) shr reuse"
if rc /= 0 then do
say "alloc error("rc") for dataset'"ipds"("mbr")' "
iterate m
end
Address TSO "execio * diskr idd (stem idatainf. finis"
if rc /= 0 then do
say "EXECIO error("rc") for dataset'"ipds"("mbr")' "
iterate m
end
/*- add info data for each memeber: (not data change */
do i=1 to idatainf.0
if translate(left(idatainf.i,3)) /= "VFY" then do
o = odatainf.0+1
odatainf.o = idatainf.i
odatainf.0 = o
end
end
/*------------------------------------------------*/
Address TSO "alloc file(oddow) dsname('"opds"("mbr")' ) shr reuse"
if rc /= 0 then do
say "alloc error("rc") for '"opds"("mbr")'"
iterate m
end
/* write all record elaborate for each member */
Address TSO "execio "odataow.0" diskw oddow (stem odataow."
Address TSO "execio "odatainf.0" diskw oddow (stem odatainf. finis "
if rc /= 0 then do
say "EXECIO error("rc") for dataset'"opds"("mbr")' "
end
end
SAY 'end - exit'
exit
|
MYLIB.SCRIPT.TEXT.INPUT(INPOWNER) input
Code: |
VFY APP RESPONSABILE AREA CRITICA CELL
VFY A31DG name surname 1 new A31DG TEST A31DG NO A31DG1
VFY A31DG name surname 2 new A31DG TEST A31DG NO A31DG2
VFY B7010 name surname 1 new B7010 TEST B7010 NO B70101
VFY B7010 name surname 2 new B7010 TEST B7010 NO B70102
VFY WIAX8 name surname 1 new WIAX8 TEST WIAX8 NO WIAX81
VFY WIAX8 name surname 2 new WIAX8 TEST WIAX8 NO WIAX82 |
MYLIB.SCRIPT.TEXT.INPUT
sample for WIAX8 input (old information)
Code: |
VFY APP RESPONS AREA CRITICA CELL
VFY WIAX8 name surname 1 old AUTO.TEST NO
VFY WIAX8 name surname 2 old AUTO.TEST1 NO
VFY= CAMPO FISSO
========================================================================
Description : APP WIAX8
======================================================================
***********************************************************************
JOBNAME* *DESCRIPTION JOB * *CLASS* *RC**RESTART*
************************************************************************
WIAX8PPR WIAX8PPR WIAX8PPR 0 00 JOB
WIAX8P01 WIAX8P01 DESCRIPTION script WIAX8P01 0 NO
WIAX8P02 WIAX8P02 DESCRIPTION script WIAX8P02 0 NO
WIAX8P03 WIAX8P03 DESCRIPTION script WIAX8P03 0 NO
WIAX8P04 WIAX8P04 DESCRIPTION script WIAX8P04 0 NO
WIAX8P05 WIAX8P05 DESCRIPTION script WIAX8P05 0 NO
WIAX8TSX WIAX8TSX WIAX8TSX 0 00 JOB
************************************************************************
|
MYLIB.SCRIPT.TEXT.OUTPUT(WIAX8)
output for new WIAX8 (update member)
news record from INPOWNER input (records 2,3) and the rest records from original member data (WIAX8) (start record 4)
Code: |
VFY APP RESPONSABILE AREA CRITICA CELL
VFY WIAX8 name surname 1 new WIAX8 TEST WIAX8 NO WIAX81
VFY WIAX8 name surname 2 new WIAX8 TEST WIAX8 NO WIAX82
========================================================================
Description : APP WIAX8
======================================================================
***********************************************************************
JOBNAME* *DESCRIPTION JOB * *CLASS* *RC**RESTART*
************************************************************************
WIAX8PPR WIAX8PPR WIAX8PPR 0 00 JOB
WIAX8P01 WIAX8P01 DESCRIPTION script WIAX8P01 0 NO
WIAX8P02 WIAX8P02 DESCRIPTION script WIAX8P02 0 NO
WIAX8P03 WIAX8P03 DESCRIPTION script WIAX8P03 0 NO
WIAX8P04 WIAX8P04 DESCRIPTION script WIAX8P04 0 NO
WIAX8P05 WIAX8P05 DESCRIPTION script WIAX8P05 0 NO
WIAX8TSX WIAX8TSX WIAX8TSX 0 00 JOB
************************************************************************
|
That's what I thought for update my member with a new data information.
any suggestions for code rexx to improve it?...
now, the only problem that I find is a position columns, only in the record begins with VFY, how to order there? between a column and the other must be a one space.
Except column VFY (colum 1 to 3), and, APP (column 5 to 12) the column RESPONSABILE must begin always from column 14...
I will have to use POS functions right?? any suggestions please??
Thanks in advance |
|