Reflection Macro: Use Current Date Information in specific field of report

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Reflection Macro: Use Current Date Information in specific field of report
# 1  
Old 05-09-2012
Reflection Macro: Use Current Date Information in specific field of report

Hi Everyone,

New to the forum, and have my first question.

I have the following Macro currently being used within Telnet to run a report for the date being entered. However, now I need the Macro to input the day after today to the the day after today.

Example: If today is May 9, 2012 - the date entered would have to be 10092012.

I though maybe I could use the Now()+1 but obviously that doesn't work in this environment. I have pasted the code being used in the macro below.

Any help would be greatly appreciated. Thanks in advance for taking the time to look at this problem of mine.


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ReflectionMacroFile [
<!ELEMENT ReflectionMacroFile (Macro)>
<!ATTLIST ReflectionMacroFile version CDATA #REQUIRED>
<!ELEMENT Macro (#PCDATA)>
<!ATTLIST Macro name CDATA "" module CDATA "ThisSession" remove CDATA "true">
]>
<!--

  Copyright (c) 2000-2006 Attachmate Corporation
  1500 Dexter Avenue North, Seattle, Washington, 98109, U.S.A.

  You have a royalty-free right to use, modify, reproduce and distribute
  this file (and/or any modified version) in any way you find useful,
  provided that you agree that Attachmate Corporation has no warranty, obligation or
  liability for its contents.

  Created 3/27/2012 11:52:21 PM by Reflection.

  This file was created using XML in the following format:
    <ReflectionMacroFile version="1.0">
    <Macro name="MyMacro" module="MacroFileModule">
    ' MyMacro Code
    </Macro>
    </ReflectionMacroFile>


-->
<ReflectionMacroFile version="1.0"><Macro name="ApptLog7087" module="NewMacros" remove="true">' Generated by the Reflection Macro Recorder on 03-27-2012 19:47:16.31.
' Generated by Reflection for UNIX and OpenVMS 14.0.7.
    On Error GoTo ErrorHandler

    Dim username As String
    Dim password As String
    Dim hosttype As String

    Const NEVER_TIME_OUT = 0

    Dim LF As String    ' Chr(rcLF) = Chr(10) = Control-J
    Dim CR As String    ' Chr(rcCR) = Chr(13) = Control-M
    Dim ESC As String   ' Chr(rcESC) = Chr(27) = Control-[

    LF = Chr(Reflection2.ControlCodes.rcLF)
    CR = Chr(Reflection2.ControlCodes.rcCR)
    ESC = Chr(Reflection2.ControlCodes.rcESC)

    username = "glspc"
    ' Password was removed from this macro for security.
    ' Prompt for (what is assumed to be) a password.
    password = Session.GetPassword( _
        Prompt:="Password:", _
        HostUserName:=username)
    If password = "" Then Exit Sub

    hosttype = "HPUX"

    With Session
        If .Connected = False Then
        .Connect
        End If

        .StatusBar = "Waiting for Prompt: login:"
        .WaitForString LF &amp; "login: ", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit username &amp; CR

        .StatusBar = "Waiting for Prompt: Password:"
        .WaitForString LF &amp; "Password: ", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit password, rcDecodePassword
        .Transmit CR
        ' .WaitForString LF &amp; " &lt; Press ENTER to continue &gt;  " &amp; CR &amp; LF, NEVER_TIME_OUT, rcAllowKeystrokes
        .WaitForPasswordExceptions LF &amp; " &lt; Press ENTER to continue &gt;  " &amp; CR &amp; LF, _
            HostUserName:=username, _
            hosttype:=hosttype, _
            Timeout:=NEVER_TIME_OUT, _
            Options:=rcAllowKeystrokes

        .CommitLoginProperties
        .Transmit CR

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: | User ID :"
        .WaitForString "m" &amp; ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "a"

        .StatusBar = "Waiting for Prompt: | User ID :   a"
        .WaitForString ESC &amp; "[7ma", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "pptlog" &amp; CR

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[5;15H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "d"

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[C", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "c"

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[C", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "6"

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[C", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "0"

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[C", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "0"

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[C", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "2"

        .StatusBar = "Waiting for Prompt: | Password:"
        .WaitForString ESC &amp; "[C", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit CR

        .StatusBar = "Waiting for Prompt: | Subcenter:"
        .WaitForString ESC &amp; "[6;15H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        .Transmit "1" &amp; CR

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[3;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF2 (Perform the VtF2 function).
        .TransmitTerminalKey rcVtF2Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[3;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "m" &amp; ESC &amp; "[3;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[4;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[5;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString " " &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "y" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "ry" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF6 (Perform the Vt F6 function).
        .TransmitTerminalKey rcVtF6Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[4;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "m" &amp; ESC &amp; "[4;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[5;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "a" &amp; ESC &amp; "[m" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "t" &amp; ESC &amp; "[m" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString " " &amp; ESC &amp; "[m" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString " " &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "m" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString "r" &amp; ESC &amp; "[m" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press CursorDown (Move the cursor down one line).
        .TransmitTerminalKey rcVtDownKey

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString " " &amp; ESC &amp; "[m" &amp; ESC &amp; "[6;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF6 (Perform the Vt F6 function).
        .TransmitTerminalKey rcVtF6Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: | Whse Area:"
        .WaitForString "5H" &amp; ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF2 (Perform the VtF2 function).
        .TransmitTerminalKey rcVtF2Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[11;74H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |  3 02:00   9084992 CONCOR  pbyl         1     2 *    3 N WM     jbenes"
        .WaitForString "m" &amp; ESC &amp; "[11;74H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF11 (Perform the Vt F11 function (ESC)).
        .TransmitTerminalKey rcVtF11Key

        .StatusBar = "Waiting for Prompt: |  3 02:00   9084992 CONCOR  pbyl         1     2 *    3 N WM     jbenes"
        .WaitForString ESC &amp; "[11;74H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF3 (Perform the VtF3 function).
        .TransmitTerminalKey rcVtF3Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: | Whse Area:"
        .WaitForString "5H" &amp; ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF3 (Perform the VtF3 function).
        .TransmitTerminalKey rcVtF3Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[4;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString " " &amp; ESC &amp; "[4;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF3 (Perform the VtF3 function).
        .TransmitTerminalKey rcVtF3Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[3;4H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: |"
        .WaitForString " " &amp; ESC &amp; "[3;4H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtF3 (Perform the VtF3 function).
        .TransmitTerminalKey rcVtF3Key

        ' The following string was not unique:
        ' .WaitForString ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes
        ' .WaitForString "m" &amp; ESC &amp; "[4;15H", NEVER_TIME_OUT, rcAllowKeystrokes
    End With
    Exit Sub

ErrorHandler:
    Session.MsgBox Err.Description, vbExclamation + vbOKOnly

    ' Recording stopped at 19:48:46.50.</Macro></ReflectionMacroFile>


Regards,
Jonathan

Last edited by Scrutinizer; 05-12-2012 at 01:53 PM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies

2. Linux

How to calculate the quarter end date according to the current date in shell script?

Hi, My question is how to calculate the quarter end date according to the current date in shell script? (2 Replies)
Discussion started by: Divya_1234
2 Replies

3. Shell Programming and Scripting

Extract Specific Information from a particular field

Hi, I am trying to extract a specific information from a file which contains more than 200 million records. Attached the input file for your reference. My file contains information below ... (4 Replies)
Discussion started by: rramkrishnas
4 Replies

4. Shell Programming and Scripting

Compare Field in Current Line with Field in Previous

Hi Guys I have the following file Essentially, I am trying to find the right awk/sed syntax in order to produce the following 3 distinct files from the file above: Basically, I want to print the lines of the file as long as the second field of the current line is equal to the... (9 Replies)
Discussion started by: moutaye
9 Replies

5. Shell Programming and Scripting

csv file field needs to be changed current system date with awk

HI, I have csv file with records as shown below. 4102,Bangalore,G10,21,08/17/2011 09:28:33:188,99,08/17/2011 09:27:33:881,08/17/2011... (1 Reply)
Discussion started by: raghavendra.nsn
1 Replies

6. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

7. Programming

Linux Kernel code "current" macro

I was going through the Linux code, i stuck with few inline assembly language code, I have tried online but in vain. Any help is much appreciated. Thanks. /* how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) { struct... (3 Replies)
Discussion started by: kumaran_5555
3 Replies

8. AIX

Change specific (not current) date to timestamp

Hello to all. I work at AIX system without perl installed and I am restricted user, so I am limited to bash. In script that I am writing, I have to read line from file and transform date that I found inside to Unix timestamp. Line in file look something like this: Tue Mar 29 06:59:00... (5 Replies)
Discussion started by: Hyperborejac
5 Replies

9. Shell Programming and Scripting

Date One Week Ago From Given Date, Not From Current Date

Hi all, I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date. So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies

10. Programming

Make-question - redefine a macro, using another macro..?

I think there is no problem to use any macro in a new macro definishion, but I have a problem with that. I can not understand why? I have a *.mak file that inludes file with many definitions and rules. ############################################## include dstndflt.mak ... One of the... (2 Replies)
Discussion started by: alex_5161
2 Replies
Login or Register to Ask a Question