Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DFSORT/ICETOOL :: RE: How to change 'K' or 'M' use Sort

$
0
0
Author: mistah kurtz
Posted: Thu May 18, 2017 1:12 pm (GMT 5.5)

I don't know if this is the most efficient way of doing it, but here is a sample rexx. You can expand it to process the complete dataset.

Code:
/******************rexx*******************/
string = '0M      60M     128K'
parse var string col1 col2 col3 .
do i = 1 to 3
  interpret "temp = col"i
  select
    when pos('K',temp) \= 0 then do
      interpret "col"i "=" (substr(temp,1,(pos('K',temp)-1))) * 1024
      end
    when pos('M',temp) \= 0 then do
      interpret "col"i "=" (substr(temp,1,(pos('M',temp)-1))) * 1048576
      end
    otherwise
  end
end
string = left(col1,10) || left(col2,10) || left(col3,10)
say string

Output:
Code:
0         62914560  131072

Hope this helps.


Viewing all articles
Browse latest Browse all 8500

Trending Articles