I have an Oracle table that contains information on the control cards on our mainframe. The data in it looks like this:
[tt]
ROW_ID State Cust Type ID DETAIL_DESC
------ ----- ---- ---- --- -------------------------------------
347621 AR COA A 10 SIGNON ESF=YES
347622 AR COA A 20 SUBMIT PROC=TAPESEND SNODE=BLAH.D.BLAH
347623 AR COA A 30 HOLD=NO
347624 AR COA A 40 SNODEID=(MY,ID)
347625 AR COA A 50 RETAIN=NO
347626 AR COA A 60 &NODE=PNODE
347627 AR COA A 70 &DSN1=A.B.C.D.ECOAARAH.NDM.BDTFILE(0)
347628 AR COA A 80 &DSN2=A.B.C.D.T9533.RARK.WCM(+1)
347629 AR COA A 90 &DISP2=(NEW,CATLG,DELETE)
347630 AR COA A 100 SIGNOFF
[/tt]
What I need to do is create an output file that looks like this:
[tt]
./* ADD NAME=ECOAARA
SIGNON ESF=YES
SUBMIT PROC=TAPESEND SNODE=BLAH.D.BLAH -
HOLD=NO -
SNODEID=(MY,ID) -
RETAIN=NO -
&NODE=PNODE -
&DSN1=A.B.C.D.ECOAARAH(0) -
&DSN2=A.B.C.D.T9533.RARK.WCM(+1) -
&DISP2=(NEW,CATLG,DELETE)
SIGNOFF
[/tt]
I imagine most of this would not be too difficult, using a function, to process each row and see if it begins with SIGNON, SIGNOFF, or SUBMIT. If not, then indent, check to see if a dash is needed, etc. However, I also need to create the line that has the NAME parameter in it, then process that line to create the variable (which is equal to E & Cust & State & Type) and also create the SIGNON card or whatever is on the first line.
Does anyone have an opinion on where I should start looking into the best way to do this? Possibly a link to good function tutorials or something?
Thanks for any help!
[tt]
ROW_ID State Cust Type ID DETAIL_DESC
------ ----- ---- ---- --- -------------------------------------
347621 AR COA A 10 SIGNON ESF=YES
347622 AR COA A 20 SUBMIT PROC=TAPESEND SNODE=BLAH.D.BLAH
347623 AR COA A 30 HOLD=NO
347624 AR COA A 40 SNODEID=(MY,ID)
347625 AR COA A 50 RETAIN=NO
347626 AR COA A 60 &NODE=PNODE
347627 AR COA A 70 &DSN1=A.B.C.D.ECOAARAH.NDM.BDTFILE(0)
347628 AR COA A 80 &DSN2=A.B.C.D.T9533.RARK.WCM(+1)
347629 AR COA A 90 &DISP2=(NEW,CATLG,DELETE)
347630 AR COA A 100 SIGNOFF
[/tt]
What I need to do is create an output file that looks like this:
[tt]
./* ADD NAME=ECOAARA
SIGNON ESF=YES
SUBMIT PROC=TAPESEND SNODE=BLAH.D.BLAH -
HOLD=NO -
SNODEID=(MY,ID) -
RETAIN=NO -
&NODE=PNODE -
&DSN1=A.B.C.D.ECOAARAH(0) -
&DSN2=A.B.C.D.T9533.RARK.WCM(+1) -
&DISP2=(NEW,CATLG,DELETE)
SIGNOFF
[/tt]
I imagine most of this would not be too difficult, using a function, to process each row and see if it begins with SIGNON, SIGNOFF, or SUBMIT. If not, then indent, check to see if a dash is needed, etc. However, I also need to create the line that has the NAME parameter in it, then process that line to create the variable (which is equal to E & Cust & State & Type) and also create the SIGNON card or whatever is on the first line.
Does anyone have an opinion on where I should start looking into the best way to do this? Possibly a link to good function tutorials or something?
Thanks for any help!