If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > HELP! Need assistance in converting I0 to I4 with different layout.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-05-03, 12:12
bigdawg352 bigdawg352 is offline
Registered User
 
Join Date: Sep 2003
Location: Peoria
Posts: 3
Question 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
Reply With Quote
  #2 (permalink)  
Old 09-08-03, 08:17
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
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
Reply With Quote
  #3 (permalink)  
Old 09-08-03, 15:29
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
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
Reply With Quote
  #4 (permalink)  
Old 09-08-03, 22:41
bigdawg352 bigdawg352 is offline
Registered User
 
Join Date: Sep 2003
Location: Peoria
Posts: 3
HELP! Need assistance in converting I0 to I4 with different layout.

Quote:
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?
Reply With Quote
  #5 (permalink)  
Old 09-09-03, 03:52
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
Re: HELP! Need assistance in converting I0 to I4 with different layout.

Quote:
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)
Reply With Quote
  #6 (permalink)  
Old 09-09-03, 17:25
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On