Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
converting bytes and megabytes to kilobytes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
knobi

New User


Joined: 16 Aug 2005
Posts: 51

PostPosted: Fri Apr 12, 2019 8:05 pm    Post subject: converting bytes and megabytes to kilobytes
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 User


Joined: 29 Apr 2008
Posts: 424
Location: Maryland

PostPosted: Fri Apr 12, 2019 9:57 pm    Post subject:
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: 2162
Location: UK

PostPosted: Sat Apr 13, 2019 2:14 am    Post subject: Reply to: converting bytes and megabytes to kilobytes
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: 51

PostPosted: Sat Apr 13, 2019 2:25 am    Post subject:
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: 51

PostPosted: Sat Apr 13, 2019 2:48 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to use RDZ for converting cobol c... balajiChid CICS 1 Tue Oct 09, 2018 8:40 pm
No new posts Converting SAS code to Cobol or Easyt... Ashish.Raghav All Other Mainframe Topics 6 Fri Jun 29, 2018 6:01 pm
No new posts converting '36000C'x Pedro PL/I & Assembler 4 Wed Jun 27, 2018 4:14 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us