Re: AIX COBOL ASSIGN error.
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jul 2009 05:11:05 -0500
How are the 49th and 50th characters defined in your record layout? Is it a
USAGE COMP
field? (This would be my first guess).
If so, you have a serious problem. You are absolutely going to have to do some
sort of "conversion" somewhere.
Can you tell us what software you are using to download the file (and exactly
what command /options you are using).
Downloading a mainframe file that has COMP (or BINARY) data mixed with
alphanumeric (character) data to AIX in a useable form definitely requires some
work or some advanced tools somewhere.
Are you doing this at/for work? Does anyone else work with getting files from
the mainframe to AIX?
As I asked before, is this a class assignment (if it isn't for work). If so,
have you asked your instructor?
I hate to get "personal" in the questions, but to get where you want from where
you are is (I think) a non-trivial task.
If you know COBOL (well enough) and have access to both the file on the
mainframe and a COBOL compiler, the easiest thing (probably) would be to write a
SIMPLE COBOL program on the mainframe to convert all COMP, COMP-3,
Packed-Decimal, BINARY fields to "usage display" - using the SIGN IS SEPARATE
clause; then to down load that file to AIX (which will now be fairly easy) and
then to have another program to convert the impacted numeric fields back.
NOTE WELL:
There are tools from some vendors that will take a record layout (such as a
COBOL COPYBOOK) and do an "Intelligent" file transfer. To the best of my
knowledge IBM COBOL for AIX does NOT include such a tool. If your record layout
includes REDEFINES, such conversions become even more difficult.
If you only have a few records with the X'0D' value in it, you could run grep or
awk (or similar) on AIX to convert those bytes to something specific and have
your program handle them that way.
You really should do a hex-dump (as suggested by others. Depending on how you
did the download, it is relatively likely that you ALSO have "LF" characters
after the 80th byte of each record and before the next record.
P.S. You did verify, didn't you, that the X'0D' value does exist in the file
BEFORE the download (in byte 49)? If not, then this too indicates some problem
in how you are doing the download.
--
Bill Klein
wmklein <at> ix.netcom.com
"gaya3" <gayathri.kalyanasundaram@xxxxxxxxx> wrote in message
news:7524f053-effd-4604-834b-ca4233199378@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 27, 3:18 pm, "William M. Klein" <wmkl...@xxxxxxxxxxxxxxxxxxxx>
wrote:
With a name like "studentfile", is there any chance that this is part of a
COBOL
class? (either an instructor led class, or one from a book)? If so, you may
want to follow there instructions.
"Record Sequential" files are pretty much a "COBOL only" type file (on AIX and
Windows). MOST "sequential" files on AIX are *intended* be available to thinks
like VI or other "text editors" or AIX utilities and EXPECT to use CR as a
record delimiter (and to usually include only "displayable" data - not binary
or
packed decimal). There are ways to get "binary" or "byte" files that do not
have record delimiters, but these are relatively unusual.
Can you tell me WHY you want this to be a record sequential file?
As I think I said in an earlier note, If you want to treat the data as 80-byte
"records" but it is coming in as line sequential (with 1-80 bytes), then do
the
following
In the Select/Assign define it as LINE SEQUENTIAL
In the FD, use the
Record Varying in Size from 1 to 80 depending on some-ws-item.
then define the record (under the FD) as
01 MyRec.
05 Each-Byte occurs 1 to 80 times depending on some-ws-item
Pic X.
Then include a FIXED length 80 byte record in WS (as well as some-ws-item)
Then in the procedure division, use
Read whateverFile INTO 80-byte-ws-rec
This will give you a "fixed" 80-byte record in WS - while "successfully"
reading
your Line Sequential file. It will "space pad" any records that you read that
are shorter than 80 bytes.
NOTE:
If you are getting CR after byte 48 or 49 (or wherever) in a record that you
THINK has 80 bytes of "real data" (no trailing spaces) on the mainframe, then
something else is going wrong with your download. Can you tell us exactly how
you are getting the file from the mainframe to AIX? Give us EXACT details, so
we can see if there may be a problem with your command. (If the file on the
mainframe has COMP, COMP_5, COMP_4 or USAGE BINARY data), then this may be
causing the problem. It may well have a binary (numeric) fields with X'0A" or
X'0D' or one of the other values that will cause problems with downloading. In
fact, if you have ANY type of "non-character" data in the mainframe file, and
you are doing "automatic" EBCDIC -> ASCII conversion in the download, you are
likely to have problems.
* * * * *
NOTE:
There is another approach - which would get a "record sequential file" on AIX.
That is to download the file from the mainframe in "binary". The problem with
this, is that it will leave you with EBCDIC data on AIX instead of
"converting"
it to ASCII. I think that IBM's AIX compiler can handle this, but it is NOT
the
approach that I would suggest.
--
Bill Klein
wmklein <at> ix.netcom.com"gaya3" <gayathri.kalyanasunda...@xxxxxxxxx> wrote
in message
news:bbd0a0af-e1c5-41a7-a482-3147a165065f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 27, 12:35 am, "William M. Klein" <wmkl...@xxxxxxxxxxxxxxxxxxxx>
wrote:
Define thefileas "sequential" (not LINESEQUENTIALin the Select/Assign clause
and put a full path name in quotes in the ASSIGN TO clause. See if this
works.
If it does, and you want to use environment variables / EXPORT (like JCL on
mainframe), then I think you will need to do some more modifications, but
first
find out if you can process thefileas recordsequentialby using the name in
quotes.
NOTE WELL:
If thisfilereally IS "linesequential" (not recordsequential), then this
will cause different problems. How was thefilecreated for you? If you used a
"text editor" or even a download from a mainframe, then I would guess that
it
is
linesequential. However, if you are absolutely Positive that the only CR's
within thefileare actual data bytes, then recordssequentialis what you want
to get to.
--
Bill Klein
wmklein <at> ix.netcom.com"gaya3" <gayathri.kalyanasunda...@xxxxxxxxx> wrote
in message
news:7fb48fce-09f4-4278-8552-aac0b1f37e35@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 25, 1:10 pm, "William M. Klein" <wmkl...@xxxxxxxxxxxxxxxxxxxx>
wrote:
When you say that records include CR, do you mean that you have 80 bytes
of
data (already) and - forexample- the 49th byte might be a "CR" that should
be
treated AS DATA (possibly in a COMP field).
OR
are you saying that if the 49th byte is a CR, that you want to treat the
first
48 bytes as data and want to treat the record as those 48 bytes plus (for
an
80
byte record) the next 32 bytes are spaces?
If you have records that ARE 80 bytes but include CR as data within
records,
then you are correct, that you need to define this as "recordsequential".
If you currently have LINESEQUENTIAL(with variable amounts of data in each
record) and want to "pad" it with spaces, then you can do this with a READ
INTO
with putting it into an 80-byte working-storage item. The system will
"pad"
each record with spaces. In this case, you may want to (probably should)
define
your input with the VARYING IN SIZE phrase (as well as defining it as LINE
SEQUENTIAL).
****
I don't think you have told us if you are an experiencedCOBOLprogrammer
who
is
new toAIX- or if you are new toCOBOLandAIX. Some of your questions sound
like you may be new toCOBOL, but if you aren't, then tell us what compiler
and
Operating System you are used to - and we may be able to help you more.
NOTE:
You still have NOT confirmed that you are using the IBM compiler onAIXand
not some otherAIXcompiler. You also haven't confirmed that you have the
Language Reference and Programming Guide for which I previously sent the
URL.
If you don't have those books yet, I would suggest that you get them. The
PG
really does have pretty useful information on it - especially if you are
used
to
COBOLon another platform.
--
Bill Klein
wmklein <at> ix.netcom.com"gaya3" <gayathri.kalyanasunda...@xxxxxxxxx>
wrote
in message
news:de4f994d-fdd2-4f1b-a10d-22defc3aa694@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 24, 4:15 pm, "Pete Dashwood"
<dashw...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
gaya3 wrote:
On Jul 23, 11:59 am, "Pete Dashwood"
<dashw...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
gaya3 wrote:
Hi All,
I have just started writing my firstCOBOLinAIXenvironment.
MyCOBOLcode is as follows :
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
FILE-CONTROL.
SELECT FILECOBV ASSIGN TO FILE1.
--------- Rest of the Code..
I have set the environment variable FILE1 as below.
export FILE1=filename
I have also tried giving
export FILE1=~/correct-path/filename
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
I am getting the following error whenever i execute the code:
IWZ200S Error detected during OPEN forfile'FILECOBV'.Filestatus
is: 35.
Filesystem indicated:FileNot Found.
Message routine called from offset 0x38 of routine
iwzWriteERRmsg.
iwzWriteERRmsg called from offset 0x574 of routine
_iwzCallUseProc.
_iwzCallUseProc called from offset 0x1538 of routine
_iwzSeqOpen.
_iwzSeqOpen called from offset 0x2ec of routine
_iwzGenericOpen.
_iwzGenericOpen called from offset 0x458 of routine TESTPGM.
IWZ901S Program exits due to severe or critical error.
=========================================================================
Could someone please tell me the solution for this..
Thanks in advance..!
Try this (assuming FILECOBV is NOT VSAM...)
select FILECOBV assign EVFILE1
export EVFILE1-STL-EVFILE1= <insert the path and filename here>
If it IS VSAM you must set the export as: export EVFILE1-VSA-EVFILE1=
<insert the path and filename here>
Please write it exactly as shown, including the case. If it works,
try substituting FILE1 for EVFILE1
Let us know how you get on.
Pete.
--
"I used to writeCOBOL...now I can do anything."- Hide quoted text -
- Show quoted text -
Hi Pete,
One more thing which i would to tell here is that ,
If i specify thefileorganization as LINESEQUENTIAL,
thefileis opened and processed..
Whereas, When i give thefileorganization asSEQUENTIAL,
I get the runtime error stated in this post..!!!!!!!!!!
Ah, my suggestion was based on the assumption that IS LineSequentialand
it
appears to have worked. That's a relief... :-)
As thefileobviously IS LineSequential, why not process it as that?
Are you not sure what LineSequentialmeans?
BTW, I think, for a first effort, your code is not bad at all. Well
done!
Pete.
--
"I used to writeCOBOL...now I can do anything."- Hide quoted text -
- Show quoted text -
Thank you for your feedback Pete..
My inputfilecontains Carriage returns and i want read past the
carriage returns..
For Eg,
If thefile'severy record contains 80 bytes, and 49th byte is a CR,
If i specify thefileorg to be LINESEQUENTIAL, the record that is
read is only upto 49th byte..
I want to read all the 80 bytes.
What should i do to read all the 80 bytes..
How do I convert afilefrom linesequentialtosequentialto process
as stated above.
Is there any way outta this..
thnx..- Hide quoted text -
- Show quoted text -
Bill Klien .. Thank you for the comprehensive reply..
"If you have records that ARE 80 bytes but include CR as data within
records,
then you are correct, that you need to define this as- Hide quoted text -
- Show quoted text -...
read more »
Hi William,
Thank you for the detailed reply..
My file from Mainfram has 80 bytes records.
It has 49th character as X'0D' and 50th character as X'25'.
51 to 80 th characters have 'data' and Not trailing spaces..
For the download
is being used."automatic" EBCDIC -> ASCII conversion in the download
Is there any solution for this without changing the download method?
Thanks for the helpful reply William!!
.
- References:
- AIX COBOL ASSIGN error.
- From: gaya3
- Re: AIX COBOL ASSIGN error.
- From: Pete Dashwood
- Re: AIX COBOL ASSIGN error.
- From: gaya3
- Re: AIX COBOL ASSIGN error.
- From: Pete Dashwood
- Re: AIX COBOL ASSIGN error.
- From: gaya3
- Re: AIX COBOL ASSIGN error.
- From: William M. Klein
- Re: AIX COBOL ASSIGN error.
- From: gaya3
- Re: AIX COBOL ASSIGN error.
- From: William M. Klein
- Re: AIX COBOL ASSIGN error.
- From: gaya3
- Re: AIX COBOL ASSIGN error.
- From: William M. Klein
- Re: AIX COBOL ASSIGN error.
- From: gaya3
- AIX COBOL ASSIGN error.
- Prev by Date: Re: Converting Cobol programs to pl/sql procedures or pakages
- Next by Date: Re: Converting Cobol programs to pl/sql procedures or pakages
- Previous by thread: Re: AIX COBOL ASSIGN error.
- Next by thread: Re: AIX COBOL ASSIGN error.
- Index(es):
Relevant Pages
|
Loading