View previous topic :: View next topic
|
Author |
Message |
knobi
New User
Joined: 16 Aug 2005 Posts: 54
|
|
|
|
Hello, i have this FB=100 file with the text below.
Does anyone can provide an approach to add an extra column converting these numbers from bytes and megabytes to Kilobytes using syncsort ?
Code: |
1 2 3
123456789012345678901234567890
-------------------- -------
text text text... 100M
text text... 19234K
text... 23232
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
- You cannot have a "file" with FB=100; you probably have a dataset with RECFM=FB, and LRECL=100? Or did you mean something else?
- Both RECFM, and LRECL have nothing to do with your task. If you do not understand this then I can only suggest: switch to the Beginners Forum
The solution in SORT seems to be extremely primitive (if you have ever tried something with SORT).
- Use IFTHEN=(WHEN=(28,1,CH,EQ,C'M'), etc.
- Use function MUL to calculate KBytes from MBytes
- Use function DIV (or MOD) to calculate KBytes from Bytes
- Use BUILD parameters to create new records in 3 different manners
- Options EDIT= (and others) might help you to format your output record properly
Any further details would mean doing your job instead of yourself, for free. Be looking for others to dupe. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
If you are using Syncsort why post in the DFSort forum? Moved. |
|
Back to top |
|
|
knobi
New User
Joined: 16 Aug 2005 Posts: 54
|
|
|
|
the IFTHEN with MUL and DIV helped a lot....thanks!
can anyone tell how to align a text with the overlay ?
for example, i have:
INREC IFTHEN=(WHEN=(10,01,SS,EQ,C'K'),
OVERLAY(95:73,05,JFY=(SHIFT=RIGHT)))
so, on pos 95, it should copy chars from 73 to 77.
Anyway, this field should have 15 positions, starting on 95.
how could this overlay be changed to align the text in a field of 15 length ? |
|
Back to top |
|
|
knobi
New User
Joined: 16 Aug 2005 Posts: 54
|
|
|
|
nevermind...it will be done with length=15 |
|
Back to top |
|
|
|