Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Location
    Peoria
    Posts
    3

    Question Unanswered: HELP! Need assistance in converting I0 to I4 with different layout.

    I am tyring to run a microfocus cobol program on an HP-UX box to access an I4 file and everytime I try to open the file as input. The program dies on a status code 39(file attributes different than program specified). I did a fh -i on the file and the only thing that is different is the file length. It should be 217 but show 215. Is there a utility I can run to change the record length of the file to 217? The output from the fh -i is below:

    FHINFO output for archdr being placed into archdr.def



    # Copyright (c) 1999 MERANT International Ltd

    IN archdr
    IE
    IT I4
    IF 215
    # Number of records - -1
    # Block size - 1023
    NL n-computer
    PK (21:10:CHARTYPE)
    AK (0:31:CHARTYPE)
    DC 1

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    Are you asking - How do I pad my record length to 217 in a file?

    If so...

    awk '{printf("%-217s\n",$0)}' yourFile > newFile

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Exclamation

    I think you need to re-post this question in the:

    comp.lang.cobol usenet forum...

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  4. #4
    Join Date
    Sep 2003
    Location
    Peoria
    Posts
    3

    HELP! Need assistance in converting I0 to I4 with different layout.

    Originally posted by Damian Ibbotson
    Are you asking - How do I pad my record length to 217 in a file?

    If so...

    awk '{printf("%-217s\n",$0)}' yourFile > newFile
    Does this still work for an indexed file?

  5. #5
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525

    Re: HELP! Need assistance in converting I0 to I4 with different layout.

    Originally posted by bigdawg352
    Does this still work for an indexed file?
    It will work on an ASCII file.

    What is an indexed file? (I know next to nothing about COBOL)

  6. #6
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Lightbulb

    I worked with Microfocus a Looooooooooong time ago and if I remeber correctly, there is a file utility which copies a file from one structure to another.

    This is why I suggested you re-post this question in the 'COBOL' forum because there may be someone that can better help you.

    Good luck.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •