Re: help with mainframe file

Discussion in 'Perl' started by John Bokma, Sep 3, 2003.

  1. John Bokma

    John Bokma Guest

    GregD wrote:

    > Im working with a mainframe file that contains packed decimal fields
    > in some of the records. Each record (line) is supposed to be a fixed
    > length of 200. Part of what Im working on is comparing the first 7


    my $line;
    my $prev = ""; # safe, since it is not 7 characters.
    my $count = 0;
    while (defined($line = <FILE>)) {

    my $current = substr($line, 0, 7); # first 7 characters
    next if $current eq $prev;

    $count++;
    $prev = $current;
    }

    --
    Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
    virtual home: http://johnbokma.com/ ICQ: 218175426
    John web site hints: http://johnbokma.com/websitedesign/
    John Bokma, Sep 3, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Barry Burd

    Java on a Mainframe?

    Barry Burd, Dec 1, 2003, in forum: Java
    Replies:
    7
    Views:
    654
    Dale King
    Dec 2, 2003
  2. Replies:
    2
    Views:
    685
    Oliver Wong
    Aug 31, 2005
  3. Mirlitone
    Replies:
    12
    Views:
    1,192
  4. GenxLogic

    Reading file from Mainframe

    GenxLogic, Jul 27, 2006, in forum: Java
    Replies:
    1
    Views:
    651
    bowman
    Jul 27, 2006
  5. =?Utf-8?B?ZGlub28=?=

    How to connect to Mainframe to download a file

    =?Utf-8?B?ZGlub28=?=, Sep 7, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,367
    Mark Rae
    Sep 7, 2006
Loading...

Share This Page