Thread View: comp.lang.rexx
6 messages
6 total messages
Started by ravi
Fri, 30 Mar 2007 03:31
Need help on this rexx
Author: ravi
Date: Fri, 30 Mar 2007 03:31
Date: Fri, 30 Mar 2007 03:31
80 lines
4023 bytes
4023 bytes
This is a multi-part message in MIME format. ------=_NextPart_000_002B_01C7725A.6C4F7C00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have file like this in IBM Mainframe DEV AUD 386 1 2 PRD AUD 386 3 4 TRN AUD 386 5 6 DEV DTP 390 1 3 PRD DTP 390 2 3 TRN DTP 390 3 3 I want reformat to=20 AUD 386 1 2 3 4 5 6 DTP 390 1 3 2 3 3 3 =20 can some one provide me how to write a rexx code for this =20 Ravi sankaravi6@gmail.com ------=_NextPart_000_002B_01C7725A.6C4F7C00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>I have file like this in IBM = Mainframe</FONT></DIV> <DIV><FONT face=3DArial size=3D2>DEV AUD =20 386 =20 1 2<BR>PRD = AUD =20 386 3 =20 4<BR></FONT><FONT face=3DArial size=3D2>TRN AUD =20 386 = 5 =20 6<BR></FONT><FONT face=3DArial size=3D2>DEV DTP =20 390 1 &nb= sp; 3<BR>PRD =20 DTP =20 390 2 &nb= sp; 3<BR>TRN =20 DTP 390 =20 3 3<BR></FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I want reformat to </FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>AUD = 386 =20 1 2 3 = 4 =20 5 6</FONT></DIV> <DIV><FONT face=3DArial size=3D2>DTP = 390 =20 1 3 2 =20 3 3 3 = </FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>can some one provide me how to write a = rexx code=20 for this</FONT></DIV> <DIV><FONT face=3DArial size=3D2><BR> <BR>Ravi<BR><A=20 href=3D"mailto:sankaravi6@gmail.com">sankaravi6@gmail.com</A><BR></FONT><= /DIV></BODY></HTML> ------=_NextPart_000_002B_01C7725A.6C4F7C00--
Re: Need help on this rexx
Author: mberg
Date: Fri, 30 Mar 2007 08:01
Date: Fri, 30 Mar 2007 08:01
79 lines
2910 bytes
2910 bytes
On Mar 30, 5:31 am, "ravi" <vze8q...@verizon.net> wrote:
> I have file like this in IBM Mainframe
> DEV AUD 386 1 2
> PRD AUD 386 3 4
> TRN AUD 386 5 6
> DEV DTP 390 1 3
> PRD DTP 390 2 3
> TRN DTP 390 3 3
>
> I want reformat to
>
> AUD 386 1 2 3 4 5 6
> DTP 390 1 3 2 3 3 3
>
> can some one provide me how to write a rexx code for this
>
> Ravi
> sankara...@gmail.com
Hi Ravi,
what about this
A.1='DEV AUD 386 1
2'
a.2='PRD AUD 386 3
4'
a.3='TRN AUD 386 5
6'
a.4='DEV DTP 390 1
3'
a.5='PRD DTP 390 2
3'
a.6='TRN DTP 390 3
3'
a.0 =
6
out. =
''
out.0 =
0
out0 =
0
Do i = 1 To a.
0
PARSE VAR A.I . A.I /* DELETE FIRST WORD
*/
PARSE VAR A.I W1 W2 VALUES /* GET WORDS 1 AND 2
*/
TEMP = W1 W2 /* DEFINE KEY
*/
IF OUT.TEMP = '' THEN DO; /* SEE IF KEY EXISTS
*/
OUT0 = OUT0 + 1 /* NO, SAVE KEY AND
*/
OUT.OUT0 = A.I /* INIT OUT STEM FOR IT
*/
out.temp =
out0
End;Else
Do
POINTER = OUT.TEMP /* YES, GET POINTER
*/
OUT.POINTER = OUT.POINTER VALUES /* ADD ADDITINOAL VALUES
*/
End;
End
i;
OUT.0 = OUT0 /* SAVE AMOUNT OF RECORDS
*/
Do i = 1 To out.0 /* Show result
*/
Say
out.i
End
i
....... Martin
Re: Need help on this rexx
Author: mberg
Date: Fri, 30 Mar 2007 08:08
Date: Fri, 30 Mar 2007 08:08
29 lines
2266 bytes
2266 bytes
hope this looks better ;-)
A.1='DEV AUD 386 1 2'
a.2='PRD AUD 386 3 4'
a.3='TRN AUD 386 5 6'
a.4='DEV DTP 390 1 3'
a.5='PRD DTP 390 2 3'
a.6='TRN DTP 390 3 3'
a.0 =6
out. = ''
out0 = 0
Do i = 1 To a.0
PARSE VAR A.I . A.I /* DELETE FIRST WORD */
PARSE VAR A.I W1 W2 VALUES /* GET WORDS 1 AND 2 */
TEMP = W1 W2 /* DEFINE KEY */
IF OUT.TEMP = '' THEN DO; /* SEE IF KEY EXISTS */
OUT0 = OUT0 + 1 /* NO, SAVE KEY AND */
OUT.OUT0 = A.I /* INIT OUT STEM FOR IT*/
out.temp = out0
End;Else Do
POINTER = OUT.TEMP /* YES, GET POINTER */
OUT.POINTER = OUT.POINTER VALUES /* ADD ADDITINOAL VALUES*/
End;
End i;
OUT.0 = OUT0 /* SAVE AMOUNT OF RECORDS*/
Do i = 1 To out.0 /* Show result*/
Say out.i
End i
Re: Need help on this rexx
Author: sri
Date: Fri, 30 Mar 2007 16:03
Date: Fri, 30 Mar 2007 16:03
33 lines
2549 bytes
2549 bytes
On Mar 30, 4:08 am, "mberg" <m...@de.ibm.com> wrote: > hope this looks better ;-) > > A.1='DEV AUD 386 1 2' > a.2='PRD AUD 386 3 4' > a.3='TRN AUD 386 5 6' > a.4='DEV DTP 390 1 3' > a.5='PRD DTP 390 2 3' > a.6='TRN DTP 390 3 3' > a.0 =6 > out. = '' > out0 = 0 > > Do i = 1 To a.0 > PARSE VAR A.I . A.I /* DELETE FIRST WORD */ > PARSE VAR A.I W1 W2 VALUES /* GET WORDS 1 AND 2 */ > TEMP = W1 W2 /* DEFINE KEY */ > IF OUT.TEMP = '' THEN DO; /* SEE IF KEY EXISTS */ > OUT0 = OUT0 + 1 /* NO, SAVE KEY AND */ > OUT.OUT0 = A.I /* INIT OUT STEM FOR IT*/ > out.temp = out0 > End;Else Do > POINTER = OUT.TEMP /* YES, GET POINTER */ > OUT.POINTER = OUT.POINTER VALUES /* ADD ADDITINOAL VALUES*/ > End; > End i; > OUT.0 = OUT0 /* SAVE AMOUNT OF RECORDS*/ > Do i = 1 To out.0 /* Show result*/ > Say out.i > End i Actually If the word1 = previous rows word1 and word2 = previous word 2 I need the word3 and 4 of all in same line
Re: Need help on this rexx
Author: Bob Welch
Date: Fri, 30 Mar 2007 18:27
Date: Fri, 30 Mar 2007 18:27
53 lines
3056 bytes
3056 bytes
Change the line : TEMP = W1 W2 /* DEFINE KEY */ to be : TEMP = W2 /* DEFINE KEY */ and execute it. You'll get what you want . On Mar 30, 12:03 pm, "sri" <sankarra...@gmail.com> wrote: > On Mar 30, 4:08 am, "mberg" <m...@de.ibm.com> wrote: > > > > > > > hope this looks better ;-) > > > A.1='DEV AUD 386 1 2' > > a.2='PRD AUD 386 3 4' > > a.3='TRN AUD 386 5 6' > > a.4='DEV DTP 390 1 3' > > a.5='PRD DTP 390 2 3' > > a.6='TRN DTP 390 3 3' > > a.0 =6 > > out. = '' > > out0 = 0 > > > Do i = 1 To a.0 > > PARSE VAR A.I . A.I /* DELETE FIRST WORD */ > > PARSE VAR A.I W1 W2 VALUES /* GET WORDS 1 AND 2 */ > > TEMP = W1 W2 /* DEFINE KEY */ > > IF OUT.TEMP = '' THEN DO; /* SEE IF KEY EXISTS */ > > OUT0 = OUT0 + 1 /* NO, SAVE KEY AND */ > > OUT.OUT0 = A.I /* INIT OUT STEM FOR IT*/ > > out.temp = out0 > > End;Else Do > > POINTER = OUT.TEMP /* YES, GET POINTER */ > > OUT.POINTER = OUT.POINTER VALUES /* ADD ADDITINOAL VALUES*/ > > End; > > End i; > > OUT.0 = OUT0 /* SAVE AMOUNT OF RECORDS*/ > > Do i = 1 To out.0 /* Show result*/ > > Say out.i > > End i > > Actually If the word1 = previous rows word1 and word2 = previous word > 2 I need the word3 and 4 of all in same line- Hide quoted text - > > - Show quoted text -
Re: Need help on this rexx
Author: Gerard Schildberger
Date: Fri, 30 Mar 2007 18:46
Date: Fri, 30 Mar 2007 18:46
61 lines
3408 bytes
3408 bytes
| Bob Welch wrote: | Change the line : | TEMP = W1 W2 /* DEFINE KEY */ | to be : | TEMP = W2 /* DEFINE KEY */ | | | and execute it. You'll get what you want . Why not just say: parse var a.i temp . values and just skip the TEMP = W2 ? ____________________________________________Gerard S. | sankarra wrote: |> mberg wrote: |>> hope this looks better ;-) |>> A.1='DEV AUD 386 1 2' |>> a.2='PRD AUD 386 3 4' |>> a.3='TRN AUD 386 5 6' |>> a.4='DEV DTP 390 1 3' |>> a.5='PRD DTP 390 2 3' |>> a.6='TRN DTP 390 3 3' |>> a.0 =6 |>> out. = '' |>> out0 = 0 |>> Do i = 1 To a.0 |>> PARSE VAR A.I . A.I /* DELETE FIRST WORD */ |>> PARSE VAR A.I W1 W2 VALUES /* GET WORDS 1 AND 2 */ |>> TEMP = W1 W2 /* DEFINE KEY */ |>> IF OUT.TEMP = '' THEN DO; /* SEE IF KEY EXISTS */ |>> OUT0 = OUT0 + 1 /* NO, SAVE KEY AND */ |>> OUT.OUT0 = A.I /* INIT OUT STEM FOR IT*/ |>> out.temp = out0 |>> End;Else Do |>> POINTER = OUT.TEMP /* YES, GET POINTER */ |>> OUT.POINTER = OUT.POINTER VALUES /* ADD ADDITINOAL VALUES*/ |>> End; |>> End i; |>> OUT.0 = OUT0 /* SAVE AMOUNT OF RECORDS*/ |>> Do i = 1 To out.0 /* Show result*/ |>> Say out.i |>> End i and what's with all the superflous semicolons ? Also, I don't recommend (not that anyone asked) using the digit 0 (zero) as part of a variable name, it's pretty hard to tell if it's an O or a 0 (on some fonts). ______________Gerard S. |>Actually If the word1 = previous rows word1 and word2 = previous word |>2 I need the word3 and 4 of all in same line- Hide quoted text - |>- Show quoted text -
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads