IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 53

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

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

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: 2432
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: 53

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: 53

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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Converting Hex to PD Special Condition SYNCSORT 3
No new posts ICE039A H INSUFFICIENT MAIN STORAGE -... DFSORT/ICETOOL 3
No new posts Converting spaces to zeroes DFSORT/ICETOOL 7
No new posts Converting a copybook value into Json... COBOL Programming 1
No new posts how to use RDZ for converting cobol c... CICS 1

Back to Top