View previous topic :: View next topic
|
Author |
Message |
milind suman Warnings : 1 New User
Joined: 19 Aug 2009 Posts: 55 Location: Pune
|
|
|
|
Hi ,
Is there any shortcut/tip for ISPF command which can help me to acheive this . The number of records are more than 50 .
My data set looks like this :
Code: |
004300 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='0019'
004400 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='0054'
004500 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='0021'
004600 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='FFFF'
005900 PERFORM FS2BUILD THRU FS2BUILD-EXIT
006000 PERFORM UC1BUILD THRU UC1BUILD-EXIT
006100 PERFORM PCOBUILD THRU PCOBUILD-EXIT
006200 PERFORM HIABUILD THRU HIABUILD-EXIT |
I have to arrange these lines as :
Code: |
004100 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='004A'
004110 PERFORM FS2BUILD THRU FS2BUILD-EXIT
004200 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='00BA'
004210 PERFORM UC1BUILD THRU UC1BUILD-EXIT
004300 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='0019'
004310 PERFORM PCOBUILD THRU PCOBUILD-EXIT
004400 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='0054'
004410 PERFORM HIABUILD THRU HIABUILD-EXIT
004500 WHEN SP-RTN-NUM='0005' AND SP-LIMIT-TYP='0021'
004510 PERFORM ARLBUILD THRU ARLBUILD-EXIT |
|
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Milind,
You can use Edit Commands like (M)ove & (A)fter.
Sushanth |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
You could put number pairs in unused columns of matching lines, then exclude the block of lines and SORT s-col e-col X to resequence them. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2596 Location: Silicon Valley
|
|
|
|
Quote: |
You could put number pairs in unused columns of matching lines, then exclude the block of lines and SORT s-col e-col X to resequence them.
|
What a wonderful idea. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
How did you generate your input? |
|
Back to top |
|
|
milind suman Warnings : 1 New User
Joined: 19 Aug 2009 Posts: 55 Location: Pune
|
|
|
|
Hi Bill ,
Thanks for this idea ..indeed helped me to arrange the records quickly ..however i had to put the even-odd numbers manualy for the matching records . before sorting . Wondering if this effort could be minimized as well . |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
maybe: renum, num off, sort trick on 73-80 (or whatever cols), renum, unnum
assuming you don't want to preserve line numbers and there is room for them (not tested - nice trick, Bill) |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2596 Location: Silicon Valley
|
|
|
|
Quote: |
Wondering if this effort could be minimized as well |
I think you could write an edit macro that did all of that, but it would not minimize your work. That is, following Bill's suggestion probably took about 2 minutes... writing a macro might take an hour or so, depending on your skill. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
if you have to manually number pair them off, why not just
Quote: |
You can use Edit Commands like (M)ove & (A)fter.
|
as suggested by Sushanth.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
How did you generate your input? |
Still unanswered. . . |
|
Back to top |
|
|
milind suman Warnings : 1 New User
Joined: 19 Aug 2009 Posts: 55 Location: Pune
|
|
|
|
gcicchet,
The number pairs can be easily generated by Excel and then pasting to DS . M..A for 50 records was tiring ...
D.ch ,
while writing the new pgm I had to copy the info from other data set wherein it was decl;ared as Data storage in 1 row for each When - Perform clause . |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
So why not process the 1 line data to get what you want ? |
|
Back to top |
|
|
milind suman Warnings : 1 New User
Joined: 19 Aug 2009 Posts: 55 Location: Pune
|
|
|
|
Ok Peter,
A(0001),A(0234),A(LABEL1)
A(0002),A(0224),A(LABEL2)
A(0021),A(0434),A(LABEL3)
A(0031),A(0234),A(LABEL4)
..
.
.
100 TIMES..
can u suggest faster way of writing the whole thing as :
when var1 = 0001 and var2= 0234
perform label1
when var1= 0002 and var2 =0224
perform label2
..
..
and so on |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Rexx, Easytrev, SAS are some utilities to do the job for you, instead of
manually shifting, renumbering, editing etc. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
what about using a simple ISPF change commmand
Code: |
123456789012345678901234567890
A(0001),A(0234),A(LABEL1)
A(0002),A(0224),A(LABEL2)
A(0021),A(0434),A(LABEL3)
A(0031),A(0234),A(LABEL4)
c "),A(" " perform " all 15
c "),A(" " and var2 = " all 7
c "A(" "when var1 = " all 1
c ")" "" all
|
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
With all respect Enrico, but that will change one line. The TS likes to have it in 2 lines, at least thats what i understood.
So in rexx you could do it like :
get input
do 1 parse input line to get the variables and pre/suffix them with
some coding
write the created values to some output |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
You are right Peter, but I tougth that the two line were just cosmetics...
unless COBOL cares!
as I said many times I do not speak funny languages |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
enrico-sorichetti wrote: |
as I said many times I do not speak funny languages |
How about Italian
Oops, and Dutch of course belongs to that. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
Oops, and Dutch of course belongs to that. |
You beat me to it! |
|
Back to top |
|
|
|