Skip to main content

FDR Mainframe Automation

Public RowValueLong As Long
Public Total_Acct As Long
Public PTH As String
Sub FDR_INFO()
    Dim oSys  As Object
    Dim oSess As Object
    Dim oScreen As Object
    
    PTH = Trim(Sheets("FILE PATH").Range("B5").Value)
    
    Set oSys = GetObject(PTH)
     
     
   
    If oSys Is Nothing Then
        MsgBox ("There is no FDR attachment system in the specified location")
        Exit Sub
    End If
    
    'GET ACCESS TO THE CURRENTLY ACTIVE SESSION...
    
    Set oSess = oSys.screen
    If oSess Is Nothing Then
        MsgBox ("No session available...stopping macro playback.")
        Exit Sub
    End If
    Total_Acct = WorksheetFunction.CountA(Sheets("PROCESSING").Range("B:B"))
    RowValueLong = InputBox("Enter the Row value")
    
    
    While Trim(Sheets("PROCESSING").Cells(RowValueLong, 2).Value) <> ""
    
    
    
    '*********************************************************
    'Get into the Bs Screen
    '*********************************************************
            
            
            oSess.putString "BS", 1, 2
            oSess.MoveTo 1, 5
            oSess.SendKeys "<EraseEOF>"
            
            WaitStatus oSess.OIA
            oSess.putString Trim((Sheets("PROCESSING").Cells(RowValueLong, 2).Value)), 1, 5
            oSess.MoveTo 1, 24
            WaitStatus oSess.OIA
            oSess.SendKeys "<Enter>"
            WaitStatus oSess.OIA
    
            Sheets("PROCESSING").Cells(RowValueLong, 3).Value = Trim(oSess.GetString(4, 48, 1))
            WaitStatus oSess.OIA
            Sheets("PROCESSING").Cells(RowValueLong, 4).Value = Trim(oSess.GetString(4, 50, 1))
            WaitStatus oSess.OIA
            Sheets("PROCESSING").Cells(RowValueLong, 5).Value = Trim(oSess.GetString(5, 48, 4))
    
    
    
    
    '*********************************************************
    'Get into the Bs5 Screen
    '*********************************************************
            
            
            WaitStatus oSess.OIA
            oSess.putString "BS5", 1, 2
            WaitStatus oSess.OIA
            oSess.MoveTo 1, 5
            WaitStatus oSess.OIA
            oSess.SendKeys "<Enter>"
            WaitStatus oSess.OIA
            
                CName = oSess.GetString(3, 11, 27)
                WaitStatus oSess.OIA
            On Error GoTo GET_LASTNAME:
                Len_CName = Len(CName)
                FND = WorksheetFunction.Find(",", CName, 1)
                lname = Left(CName, FND - 1)
                
                Sheets("PROCESSING").Cells(RowValueLong, 7).Value = lname
    
                FName = Mid(CName, FND + 1, Len_CName - FND)
                
                Sheets("PROCESSING").Cells(RowValueLong, 6).Value = FName
                GoTo NextStp:
GET_LASTNAME:
    
                Sheets("PROCESSING").Cells(RowValueLong, 6).Value = CName
NextStp:
                WaitStatus oSess.OIA
                Sheets("PROCESSING").Cells(RowValueLong, 8).Value = Trim(oSess.GetString(5, 11, 27))
                WaitStatus oSess.OIA
                Sheets("PROCESSING").Cells(RowValueLong, 9).Value = Trim(oSess.GetString(6, 11, 27))
                WaitStatus oSess.OIA
                Sheets("PROCESSING").Cells(RowValueLong, 10).Value = Trim(oSess.GetString(7, 6, 19))
                WaitStatus oSess.OIA
                Sheets("PROCESSING").Cells(RowValueLong, 11).Value = Trim(oSess.GetString(7, 28, 2))
                WaitStatus oSess.OIA
                Sheets("PROCESSING").Cells(RowValueLong, 12).Value = Trim(oSess.GetString(8, 5, 10))
                WaitStatus oSess.OIA
            oSess.putString "BS", 1, 3
            WaitStatus oSess.OIA
            oSess.MoveTo 1, 5
            WaitStatus oSess.OIA
            oSess.SendKeys "<Enter>"
            WaitStatus oSess.OIA
                
    RowValueLong = RowValueLong + 1
    
            WaitStatus oSess.OIA
    Wend
    
    
End Sub

Comments

Popular posts from this blog

Python - PyQt5 set Background image

import sys from PyQt5.QtCore import QSize from PyQt5.QtGui import QImage, QPalette, QBrush from PyQt5.QtWidgets import * class MainWindow ( QWidget ): def __init__ ( self ): QWidget. __init__ ( self ) self .setGeometry( 100 , 100 , 300 , 200 ) oImage = QImage( "test.jpg" ) sImage = oImage.scaled(QSize( 300 , 200 )) # resize Image to widgets size palette = QPalette() palette.setBrush( 10 , QBrush(sImage)) # 10 = Windowrole self .setPalette(palette) self .show() if __name__ == "__main__" : app = QApplication(sys.argv) oMainwindow = MainWindow() sys.exit(app.exec_())

pymsgbox - python package for message box

#This tutorial for to get a confirmation from the user by promting window #Python package "pymsgbox" needs to be install before run this below code #To install "pymsgbox" package go to command prompt and type in "PIP3 INSTALL pymsgbox" import pymsgbox #Displays a message box with OK and Cancel buttons. Number and text of buttons can be customized. Returns the text of the button clicked on. replyV = pymsgbox.confirm( text = 'Please login your application and click on on okay' , title = 'Login Confirmation' , buttons =[ 'OK' , 'Cancel' ]) print (replyV) #Displays a simple message box with text and a single OK button. Returns the text of the button clicked on. replyV = pymsgbox.alert( text = '' , title = '' , button = 'OK' ) print (replyV) #Displays a message box with text input, and OK & Cancel buttons. Returns the text entered, or None if Cancel was clicked. replyV1 = pyms