IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

converting bytes and megabytes to kilobytes


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Fri Apr 12, 2019 8:05 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Fri Apr 12, 2019 9:57 pm
Reply with quote

    - 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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 13, 2019 2:14 am
Reply with quote

If you are using Syncsort why post in the DFSort forum? Moved.
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Sat Apr 13, 2019 2:25 am
Reply with quote

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
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 54

PostPosted: Sat Apr 13, 2019 2:48 am
Reply with quote

nevermind...it will be done with length=15
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Converting S9(18) value to a decimal ... DFSORT/ICETOOL 6
Search our Forums:

Back to Top