Announcement

Collapse
No announcement yet.

Comparing PC and mainframe files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing PC and mainframe files

    Is there any way of doing the above ? I noticed that if I choose "Compare Folder" I see a tab option that allows me to choose an FTP site, but I saw nothing comparable for file compare.

    The background/reason for this is that we do a lot of maiinframe development using a PC application. We then reach a certain level of testing where the source code needs to be lifted to the mainframe etc etc. One inevitable problem is that it requires superhuman discipline to ensure that you ONLY have one copy of the source code. You inevitably end up wondering which of the 2 versions is the latest, does it have ALL of the code the the older one has etc etc.

    I realise I can download the mainframe file to a separate folder on the PC and compare them that way. I'm just wondering if there's a way to avoid this downlaod.

  • #2
    Re: Comparing PC and mainframe files

    Hi Michael!

    How do you access the mainframe files? Is there a kind of ftp-server at the host? If yes, simply choose the corresponding directory on the ftp-site for browsing for the right file.
    How else do you plan to address the file?
    If it has a static path and name you can call BC2 with the local file and the ftp-location as parameters:

    "bc2.exe d:\file.dat ftp://server.com/file.dat"

    The ftp-file will be downloaded, but only as a temp-file.
    If you want to use the BC contextmenu to select the files and folders to compare, search the forum for "netdrive"


    Hope this helps ...


    Bye
    Christoph

    Comment


    • #3
      Re: Comparing PC and mainframe files

      Thanks for replying Christoph. Have experimented a bit and have reached the following stage

      I specify a local file as the firstfile for comparison, but the file on the mainframe (which is a TSO PDS if that says anything to you) is never accessed. I specify the following as the m/f file specification

      ftp://myuserid:[email protected]_ftp_address/plas.cobol(plas1400)

      I have set the FTP options to ascii and uppercase filenames.
      The filename plas.cobol(plas1400) means (in TSO) 'myuserid.plas.cobol(plas1400)'.

      I should mention that I have a s/w product called Ipswitch WS_FTP Pro 2006. This allows me to access the m/f from my PC and I CAN browse the plas1400 file above using this.

      It might turn out that what I'm trying to do is a "can't be done" at the moment with BC2. If that's the case, fair enough, I won't waste any more time, but it sure as hell would be neat if I could get this to work.

      Remember, at the end of the day, the file I'm trying to acces is NOT a linux type file, it's mainframe file.

      BTW. I tried experimenting by copying the PLAS1400 PDS member to a simple sequential file, but that doesn't SEEM to help either.

      Comment


      • #4
        Re: Comparing PC and mainframe files

        Instead of specifying the url to the file in the File Viewer directly or on the command line, does it work to open the FTP site in the Folder Viewer and then launch it by double clicking the file name? Or is it not possible to browse to the file in the Folder Viewer?
        Chris K Scooter Software

        Comment


        • #5
          Re: Comparing PC and mainframe files

          I am SO impressed !!!! Sorry to take so long to get back to you Chris (and thanks for your suggestion).

          This SEEMS to work, and this is how I solved my problem (detailed description in case anyone else needs the same solution).

          Starting BC, I selected Folders and New folder comparison. I also selected the open folder icon for the left folder.

          When presented with the window entitled "Browse for left base folder", I selected the ftp site tab and entered our mainframe's ftp address, the inital remote directory (my PDS in quotes, ie 'misi01.plas.cobol', WITHOUT trying to specify the actual member name - it doesn't seem to like that). I removed the anonymous login option and specified my mainframe userid/password. Select OK

          Now I deliberately didn't specify anything for the right folder, but simply clicked OK.

          Was now presented with a list of the members in the PDS. Note that if you don't see the list, try selecting View, Log, and check that the first option says Hide Log (ie, indicating that Show log is on). At the bottom of the screen, you should see a load of stuff indicating how the connection fared. Here's an example


          2006-01-09 14:50:03 Sent> TYPE I
          2006-01-09 14:50:03 Recv> 200 Representation type is Image
          2006-01-09 14:50:03 Sent> SYST
          2006-01-09 14:50:03 Recv> 215 MVS is the operating system of this server. FTP Server is running on z/OS.
          2006-01-09 14:50:03 Sent> PWD
          2006-01-09 14:50:03 Recv> 257 "'MISI01.'" is working directory.
          2006-01-09 14:50:03 Sent> FEAT
          2006-01-09 14:50:03 Recv> 211 no Extensions supported
          2006-01-09 14:50:03 Sent> CWD 'misi01.plas.cobol'
          2006-01-09 14:50:03 Recv> 250 The working directory "MISI01.PLAS.COBOL" is a partitioned data set
          2006-01-09 14:50:03 Sent> PWD
          2006-01-09 14:50:03 Recv> 257 "'MISI01.PLAS.COBOL'" partitioned data set is working directory.
          2006-01-09 14:50:03 Sent> TYPE A
          2006-01-09 14:50:03 Recv> 200 Representation type is Ascii NonPrint
          2006-01-09 14:50:03 Sent> PORT bla-bla
          2006-01-09 14:50:03 Recv> 200 Port request OK.
          2006-01-09 14:50:03 Sent> LIST
          2006-01-09 14:50:03 Recv> 125 List started OK
          2006-01-09 14:50:03 Recv> 250 List completed successfully.

          Now, double-click on the member you're interested in and you should see it in the left-hand pane. In the right-hand pane, select the Open file icon and drill down to the relevant file you're interested in comparing from the PC.

          Works a TREAT !!!!

          Comment


          • #6
            Re: Comparing PC and mainframe files

            One last question. Is there any way of taking care of special characters in the comparison? What I mean by this is that the Swedish characters 'åäöÅÄÖ' are shown correctly for the PC file, but "incorrectly" for the m/f file resulting in "differences" in the files. It's not a big deal, but it WOULD be nice to be able to eliminate it.

            Comment


            • #7
              Re: Comparing PC and mainframe files

              To display these characters correctly, you'll want to select a different character encoding. To do this, from the File Viewer, select Tools | Edit Current Rules. In the Character set section, select <prompt when loading>. BC will then prompt you to specify the character encoding for both the left and right sides. Most IBM mainframes use an EBCDIC encoding.

              Comment


              • #8
                Re: Comparing PC and mainframe files

                Thanks Lynn, worked nicely using OEM - Nordic (surprisingly, both EBCDIC options made the code totally unreadable). Next question (there always is, isn't there ? )

                Is there any way of "specifying" that a file from the m/f is always opened with one conversion option, and a file from the PC another (rather than having to prompt and answer every time). Maybe, for example, by "detecting" the string '.COBOL' in the filename or something similar ?

                Will start reading up on command line calls - that might be a way to do what I want to ?

                Okay - first attempt at running it as a line command.

                I enter the command bc2.exe @cobol_compare.txt
                and this file in turn contains

                log verbose
                load "ftp://userid[email protected]_ftp_address/'misi01.plas.cobol'" "h:\mash\mfe\projects\plas\plas1400.cbl"

                Couple of things I'm noticing.
                1 If I don't specify the pw in the string, I don't seem to get prompted for it.
                2 How do I select the member PLAS1400 from the ftp site automatically ? I tried specifying it as ... 'misi01.plas.cobol(plas1400)'.... but that didn't work. I also tried the above and inserted (as the line after the load) select lt.plas1400 but that didn't work either
                3 How do I load/specify the conversion representation I want to be used ? I'm seeing the following in the log

                representation type is ascii nonprint

                . In fact, is there any way of specifying the "associated with" for an FTP site and file ?

                The end result is I always end up with "Unable to load base folder".

                Suggestions gratefully received.

                Comment


                • #9
                  Re: Comparing PC and mainframe files

                  Is there any way of "specifying" that a file from the m/f is always opened with one conversion option, and a file from the PC another (rather than having to prompt and answer every time). Maybe, for example, by "detecting" the string '.COBOL' in the filename or something similar?
                  This isn't possible using just BC. Unless it detects a Unicode file BC always uses the same codepage for both files. One workaround would be to have BC use an external converter that checks the file extension to determine the source codepage and then converts both files into Unicode before BC compares them. Using something like Java's StreamReader/Writer classes would make that pretty easy. There's a few existing utilities that will do the conversion too, including GNU gettext for Win32 (free), Unifier ($15), and TextPipe Pro ($259).

                  If I don't specify the pw in the string, I don't seem to get prompted for it.
                  If you've logged into the website through BC interactively it probably has your password saved, so it won't prompt for it.

                  How do I select the member PLAS1400 from the ftp site automatically ? I tried specifying it as ... 'misi01.plas.cobol(plas1400)'.... but that didn't work. I also tried the above and inserted (as the line after the load) select lt.plas1400 but that didn't work either ... The end result is I always end up with "Unable to load base folder".
                  If you're trying to compare a pair of files you need to use the FILE-REPORT command. LOAD only works for a pair of directories or archives; it's the same as loading two things in the directory comparison.

                  How do I load/specify the conversion representation I want to be used ? I'm seeing the following in the log
                  Use the "AfterLogin" tweak documented in our Tweaks knowledge base article to send a command to the FTP server. That's going to be server specific, so you'll need to find that out from your admin.
                  Zoë P Scooter Software

                  Comment


                  • #10
                    Re: Comparing PC and mainframe files

                    Okay - I'm beginning to wonder if this is doable. Here was my latest attempt. First, a BAT file (I got tired of entering the long string every time)
                    Code:
                      
                    @echo on
                    bc2 @bc2_1.txt "ftp://user:[email protected]/'misi01.plas.cobol'" "h:\mash\mfe\projects\plas\plas1400.cbl" diff.htm
                    and bc2_1.txt contained (based on an example I found on this site)
                    Code:
                    select left:plas1400
                    file-report layout:side-by-side options:display-context,line-numbers output-to:%3 output-options:html-color %1 %2
                    Couple of things strike me.

                    How do I define/select the fact that I want to use PLAS1400 from misi01.plas.cobol ?

                    When I run it, I see the following
                    Stream not supported in this container
                    (does this indicate a limitation in what I'm trying to do ?)

                    Comment


                    • #11
                      Re: Comparing PC and mainframe files

                      Your script should only be:
                      Code:
                      file-report layout:side-by-side options:display-context,line-numbers output-to:%3 output-options:html-color %1 %2
                      There are two forms of the file-report command. The first form operates on the currently selected files and requires a select statement. The second form (listed above) specifies two files to compare by name at the end of the command, and it doesn't use a select statement. Both styles are documented in the Command Line & Scripting section of the help file.

                      Also, if you decide to use the form of file-report that operates on selected files, you'll need to change your select statement. The select command doesn't allow you to select a named file, so "select leftlas1400" isn't a valid command. See the description of the select statment in the Help file's scriping reference for details.

                      The error "stream not supported in this container" probably means BC is getting passed a directory listing when it expects a file name.

                      In your example, you're passing the path "ftp://user[email protected]/'misi01.plas.cobol'" as the first command line argument to the script. This is expanded as the %1 variable in the script. For the file-report command, this needs to be a file name, not a directory name. Instead of using this path, open the mainframe file in an interactive session of BC's File Viewer. Copy the path the file viewer displays and use that instead of "ftp://user[email protected]/'misi01.plas.cobol'".
                      Chris K Scooter Software

                      Comment


                      • #12
                        Re: Comparing PC and mainframe files

                        Okay - we're inching forward. Couple of things now (either discrepancies in the way the s/w works or a bug ?)

                        If I understand you correctly, I start BC2 interactively, select the folder and FTP option (as I mentioned earlier). I get shown (correctly) the list of members in the PDS and select one. In the next window, left pane, I see the following text for the file
                        which seems to make sense. First comment. If I try and specify this string from the beginning in the folder/ftp window (ie specify 'misi01.plas.cobol'/plas1400 in the initial remote directory entry), I get "folder not available". Since it's obviously (?) not drilling down all the way, I gues I'm probably going to have to (?) submit this as an enhancement request rather than report it as a bug ?

                        I tried the other alternative you outlined. Here are my simple files this time. First the bat file
                        Code:
                          
                        @echo on
                        bc2 @bc2_1.txt "h:\mash\mfe\projects\plas\plas1400.cbl" "ftp://user:[email protected]/'misi01.plas.cobol'/plas1400" diff.htm
                        and then bc2_1.txt
                        Code:
                        file-report layout:side-by-side options:display-context,line-numbers output-to:%3 output-options:html-color %1 %2
                        .
                        In this situation, I get prompted for the conversion options
                        as expected, after which .... BC2 dies (I changed the order of the files as you can see, so that the .cbl file comes first. In my rules for .cbl files, I've specified the character set as "Prompt when loading")

                        When I say dies, the BC script window stays up, but I never see any "normal" BC2 compare window.

                        Comment


                        • #13
                          Re: Comparing PC and mainframe files

                          I talked to Craig about this, and he said the "Prompt When Loading" character encoding selection isn't likely to work from scripts.

                          For now, if you need to use this option, you'll need to compare interactively.

                          If you need to automate this comparison using scripting, the only option is to make an external conversion rule as Craig described in his earlier post, either using GNU gettext or by writing your own code in Java for the conversion.

                          If you need help setting up an external conversion rule for this purpose, please let me know what character encoding the left and right side files are in and I'll put together a rule.

                          Also, the script won't display anything other than the scripting window. The only output that you'll get from a successful run is the output html file, and you'll have to open that in your web browser to check the output.
                          Chris K Scooter Software

                          Comment


                          • #14
                            Re: Comparing PC and mainframe files

                            Thanks Lynn, worked nicely using OEM - Nordic (surprisingly, both EBCDIC options made the code totally unreadable).
                            Have installed 2.4.1 and notice that with this version, OEM Nordic is now showing garbage for mainframe files - I have to specify 00500 - IBM EBCDIC International. Was the original code incorrect and now corrected ? (Trouble with 00500 is I no longer get to see the special Swedish characters 'åäöÅÄÖ' - which I'm pretty certain I did before)

                            Alternatively, is there any way of "zapping" into the translate table (if there is one) the correct values ?

                            Comment


                            • #15
                              Re: Comparing PC and mainframe files

                              The character encodings that Beyond Compare uses are provided by Windows, so I don't know why it would have changed.

                              Is it possible the files are in fact in a different character encoding than they used to be?

                              Can you open up the files in any other programs?
                              Chris K Scooter Software

                              Comment

                              Working...
                              X