View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Sun Mar 08, 2009 2:36 pm Post subject: Strip Records |
|
|
Hi,
I have an reqiurement i need to strip spaces & other unwanted data from file . It will be greatful if anyone can provide me the rexx code
Input file is
Code: |
V001.00.....CCDDDA 0F2FL6540211200914295880087723354010410001465
CCDDDA 0F2FM1540211200914300060089272154010410001465
CCDDDA 0F2FM0540211200914300050028872454010410001465
V001.00.....CCDDDA 0F2FL6540211200914295880087723354010410001465
CCDDDA 0F2FM1540211200914300060089272154010410001465
V001.00.....CCDDD 002H92540211200914244190087779125412343802812
CCDDD 002H92540211200914245400087779125412343802942
CCDDD 002H92540211200914250040087779125412343803002
|
output should be
Code: |
CCDDDA 0F2FL6540211200914295880087723354010410001465
CCDDDA 0F2FM1540211200914300060089272154010410001465
CCDDDA 0F2FM0540211200914300050028872454010410001465
CCDDDA 0F2FL6540211200914295880087723354010410001465
CCDDDA 0F2FM1540211200914300060089272154010410001465
CCDDD 002H92540211200914244190087779125412343802812
CCDDD 002H92540211200914245400087779125412343802942
CCDDD 002H92540211200914250040087779125412343803002
|
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sun Mar 08, 2009 10:37 pm Post subject: |
|
|
since this is in the ISPF section, I assume it is a request for an ISPF edit macro. Something like this should work (assuming there is no @ character in the data):
Code: | /* REXX */ Address isredit
'macro'
'c " " "@" all'
'c "@" "" all 1 13' /* note no space between 2nd set of double quotes */
'c "@" " " ALL'
|
This is much more efficient than looping and shifting each line. If you don't know what character you can choose (@ in my example), you can add logic to search for an unused hex character. If none can be found, you can add logic to do this a different way, most likely with a shifting (( loop or a simple get/change/replace for each line. also, since this is a data file, depending on your needs, you may want to add a PRESERVE ON command in there too. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Sun Mar 08, 2009 11:05 pm Post subject: |
|
|
kolusu,
Yes this is the same question i asked in Utilites section.. but i want to try same thing with rexx.Generally we assume if the DCB parameters are not given we consider it as FB as RECFM & LRECL = 80
semigeezer,
Thanks..
I will try this and let u know..
Thanks,
Siva |
|
Back to top |
|
 |
|
|