View previous topic :: View next topic |
Author |
Message |
neoframer Beginner
Joined: 28 Jun 2003 Posts: 10 Topics: 6
|
Posted: Mon Jan 26, 2004 11:20 pm Post subject: Pulling information from file and putting it on message |
|
|
I need to do following :
I need to read a PDS member (lrecl 80) , then extract the information on 2nd , 3rd & 4th line between column 75 - 80 , & then concatenate that information & display it on screen. Need to do this by executing a single command.
For example:
Code: |
s fasjkfg assgdsag ddggdfgh df gfdafgdgdgdg
gadsfg gdghdjd dgjhd gdgd gkfkfkf gggggg
ghhhh 222222222222
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn f
-----
-----
-----
-----
-----
|
So , what I need to do is , when I execute a command , I should get this display on screen :
|
|
Back to top |
|
|
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Wed Jan 28, 2004 6:36 am Post subject: |
|
|
neoframer,
I have done it for a sample from cols 25-30.Change the following stmt as follows for extracting from cols 75-80
Code: |
parse var record d1+74 d2+6
|
Code: |
/* rexx - spn */
"Alloc dd(Input) da('your.pds(member)') Shr Reuse"
"Execio * Diskr Input(Stem in. Finis"
"Free Fi(Input)"
x1 = parse_line(in.2)
x2 = parse_line(in.3)
x3 = parse_line(in.4)
say x1 x2 x3
exit
parse_line:
arg record
parse var record d1+24 d2+6
return d2
|
Hope this helps...
Cheers,
Coolman
________
Ford Airstream |
|
Back to top |
|
|
|
|