  C RUBY-ON-RAILS MYSQL ASP.NET DEVELOPMENT RUBY .NET LINUX SQL-SERVER REGEX WINDOWS ALGORITHM ECLIPSE VISUAL-STUDIO STRING SVN PERFORMANCE APACHE-FLEX UNIT-TESTING SECURITY LINQ UNIX MATH EMAIL OOP LANGUAGE-AGNOSTIC VB6 MSBUILD # How to convert old CDC mainframe PRUs to bytes?  » development » How to convert old CDC mainframe PRUs to bytes?

By : tammy drachel
Date : November 25 2020, 07:22 PM
hope this fix your issue Quoted directly from Wikipedia: code : ## How to turn this simple 5 bytes back into 4 bytes ? (algorithm to convert 4 bytes into 5 bytes is known)

By : user2633784
Date : March 29 2020, 07:55 AM
Any of those help The algorithm to convert input 8 digit hex number into 10 digit are following: , From this conversion algorithm:
code :
``````x1 = 1 * 16^8 * 2^3
x2 = 2 * 16^7 * 2^2
x3 = 3 * 16^6 * 2^1
x4 = 4 * 16^4 * 2^4
x5 = 5 * 16^3 * 2^3
x6 = 6 * 16^2 * 2^2
x7 = 7 * 16^1 * 2^1
x8 = 8 * 16^0 * 2^0
``````
``````x1 = 1 * 16^7 * 16^1 * 2^3
x2 = 2 * 16^6 * 16^1 * 2^2
x3 = 3 * 16^5 * 16^1 * 2^1
x4 = 4 * 16^4 * 2^4
x5 = 5 * 16^3 * 2^3
x6 = 6 * 16^2 * 2^2
x7 = 7 * 16^1 * 2^1
x8 = 8 * 16^0 * 2^0
``````
``````x1 = 1 * 16^7 * 2^4 * 2^3
x2 = 2 * 16^6 * 2^4 * 2^2
x3 = 3 * 16^5 * 2^4 * 2^1
x4 = 4 * 16^4 * 2^4
x5 = 5 * 16^3 * 2^3
x6 = 6 * 16^2 * 2^2
x7 = 7 * 16^1 * 2^1
x8 = 8 * 16^0 * 2^0
``````
``````x1 = 1 * 16^7 * 2^7
x2 = 2 * 16^6 * 2^6
x3 = 3 * 16^5 * 2^5
x4 = 4 * 16^4 * 2^4
x5 = 5 * 16^3 * 2^3
x6 = 6 * 16^2 * 2^2
x7 = 7 * 16^1 * 2^1
x8 = 8 * 16^0 * 2^0
``````
``````x1 = 1 * 16^7 << 7
x2 = 2 * 16^6 << 6
x3 = 3 * 16^5 << 5
x4 = 4 * 16^4 << 4
x5 = 5 * 16^3 << 3
x6 = 6 * 16^2 << 2
x7 = 7 * 16^1 << 1
x8 = 8 * 16^0 << 0
``````
``````AAAABBBB CCCCDDDD EEEEFFFF GGGGHHHH
``````
``````0AAAA0BB BB0CCCC0 DDDD0EEE E0FFFF0G GGG0HHHH
``````
``````void convert(unsigned char five[], unsigned char four[]) {
four = (five << 1) & 0xF0  // 11110000
| (five << 2) & 0x0C  // 00001100
| (five >> 6) & 0x03; // 00000011
four = (five << 3) & 0xF0  // 11110000
| (five >> 4) & 0x0F; // 00001111
four = (five << 5) & 0xE0  // 11100000
| (five >> 3) & 0x10  // 00010000
| (five >> 2) & 0x0F; // 00001111
four = (five << 7) & 0x80  // 10000000
| (five >> 1) & 0x70  // 01110000
| (five)      & 0x0F; // 00001111
}
``````
`````` 08 42 10 84 21      11 11 11 11
10 84 21 8C 63      22 22 33 33
52 D8 D0 88 64      AB CD 12 34
21 4E 84 98 62      45 78 96 32
7B DE F7 BD EF      FF FF FF FF
`````` ## How to convert Text into Numeric in Mainframe

By : user3059732
Date : March 29 2020, 07:55 AM
this will help For a COBOL solution, try using UNSTRING and a JUSTIFIED RIGHT receiving field. Here is an example program (IBM Enterprise COBOL) to illustrate.
code :
``````  IDENTIFICATION DIVISION.
PROGRAM-ID. EXAMPLE1.
DATA DIVISION.
WORKING-STORAGE SECTION.
01  SOURCE-DATA       PIC X(4).
01  DEST-DATA         PIC X(4) JUSTIFIED RIGHT.
PROCEDURE DIVISION.
MOVE '123' TO SOURCE-DATA
UNSTRING SOURCE-DATA DELIMITED BY SPACE
INTO DEST-DATA
DISPLAY 'SOURCE >' SOURCE-DATA '<'
DISPLAY 'DEST   >' DEST-DATA '<'

MOVE '1' TO SOURCE-DATA
UNSTRING SOURCE-DATA DELIMITED BY SPACE
INTO DEST-DATA
DISPLAY 'SOURCE >' SOURCE-DATA '<'
DISPLAY 'DEST   >' DEST-DATA '<'
GOBACK
.
``````
``````SOURCE >123 <
DEST   > 123<
SOURCE >1   <
DEST   >   1<
`````` ## Convert Mainframe SORT to Shell Script

By : suxuan xu
Date : March 29 2020, 07:55 AM
will be helpful for those in need Is there any easy way to convert JCL SORT to Shell Script? , I have figured an answer:
code :
``````awk -v FIELDWIDTHS="14 1 8 1 8 1 8 1 8 1 8 1 8 13" \
'{if(!(\$2 in a)) {a[\$2]=\$2; c[\$2]=\$4; e[\$2]=\$6; g[\$2]=\$8; i[\$2]=\$10; k[\$2]=\$12} \
b[\$2]+=\$3; d[\$2]+=\$5; f[\$2]+=\$7; h[\$2]+=\$9; j[\$2]+=\$11; l[\$2]+=\$13;} END \
{for(id in a) printf("%14s%s%s%s%s%s%s%s%s%s%s%s%s%13s\n","",a[id],b[id],c[id],d[id],e[id],f[id],g[id],h[id],i[id],j[id],k[id],l[id],"");}' input
``````
``````awk -v FIELDWIDTHS="14 1 8 1 8 1 8 1 8 1 8 1 8 13"
``````
``````{if(!(\$2 in a)) {a[\$2]=\$2; c[\$2]=\$4; e[\$2]=\$6; g[\$2]=\$8; i[\$2]=\$10; k[\$2]=\$12}
``````
``````b[\$2]+=\$3; d[\$2]+=\$5; f[\$2]+=\$7; h[\$2]+=\$9; j[\$2]+=\$11; l[\$2]+=\$13;} END
``````
``````{for(id in a) printf("%14s%s%s%s%s%s%s%s%s%s%s%s%s%13s\n","",a[id],b[id],c[id],d[id],e[id],f[id],g[id],h[id],i[id],j[id],k[id],l[id],"");}
`````` ## Python - how to use mainframe() method in QWebEnginePage [error of mainframe()]

By : user2046838
Date : March 29 2020, 07:55 AM
may help you . It seems that you are using a Qt Webkit guide that is deprecate from Qt 5.6, it is currently used Qt WebEngine that has changed many classes and methods since it is based on chromium, in this link you can find a guide how to port Qt Webkit to Qt WebEngine . In your case there is no mainFrame(), and the way to get HTML is asynchronous:
code :
``````import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView

class Browser(QWebView):
def __init__(self):
QWebView.__init__(self)

def _result_available(self, ok):
if ok:
frame = self.page()
frame.toHtml(self.callback)

def callback(self, html):
print(unicode(html).encode('utf-8'))

if __name__ == '__main__':
app = QApplication(sys.argv)
view = Browser() ## From a 3270 Mainframe screen call web site passing data from Mainframe automatically 