Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Signed data in Line sequential file

Status
Not open for further replies.

tanim

IS-IT--Management
Dec 10, 2010
4
BD
Hi,
i am trying to read signed data from Line sequential file, AFAIK, the input file contains values in ASCII encoding. Here are some sample lines of values from the input file -

0000002010060000000000000BALANCF/BF000000021088000000000000000000000000000000000
0000002010060000000000365BALANCF/BF0000000016110p0000000000000000000000000000000
0000002010060000000000401BALANCF/BF000000869180000000000000000000000000000000000
0000002010060000000010106BALANCF/BF0000000007000p0000000000000000000000000000000
0000002010060000000010111BALANCF/BF0031387071823q0000000000000000000000000000000
0000002010060000000010112BALANCF/BF0119483000000p0000000000000000000000000000000
0000002010060000000010113BALANCF/BF0057370886190w0000000000000000000000000000000
0000002010060000000010401BALANCF/BF000292706685240000000000000000000000000000000

The 14 digits after 'BF' constitutes the signed values i.e.0119483000000p (-ve), 0057370886190w (-ve), 00029270668524 (+ve) etc.

existing program defines a file to read values from the input-
FD FILEA LABEL RECORDS STANDARD.
01 FILA.
02 SRC PIC 999.
02 BTC PIC 999.
02 YY PIC 9999.
02 MM PIC 99.
02 DD PIC 99.
02 ACF PIC X.
02 DEP PIC 99.
02 LOC PIC 999.
02 ACC PIC 9(5).
02 VOU PIC X(10).
02 BAM PIC S9(12)V99.
02 PNO PIC 9(5).
02 FIL PIC X(26).

But it's generating compile time error -
PP 5724-V62 IBM COBOL for AIX 3.1.0 in progress ...
LineID Message code Message text
28 IGYGR1512-E A signed data item without the "SIGN IS SEPARATE" clause
was found in a file definition for a file with
"ORGANIZATION LINE SEQUENTIAL". Execution results are
unpredictable.
28 IGYGR1213-I The "LABEL" clause was processed as comments for this
file definition.
Same message on line: 43
Messages Total Informational Warning Error Severe Terminating
Printed: 3 2 1
End of compilation 1, program P41053, highest severity: Error.
Return code 8

Please suggest what to do. my queries-
1. what is the explanation of the E-level message?
2. Is it actually any rule? or I am missing some compiler options?

 
Not sure what your choices are in IBM COBOL on AIX.

Look for ORGANIZATION BINARY SEQUENTIAL

Tom Morrison
Micro Focus
 
If you have a signed numeric you have to tell the compiler where the location of the sign character. If the sign is after the numeric value then use: example below.

02 BAM PIC S9(12)V99 SIGN IS TRAILING VALUE ZEROES.

If before the numeric value I believe you will use SIGN IS
HEADING.
 
You must use SIGN IS LEADING/TRAILING SEPARATE. This means the the sign must be an actual "+" or "-" preceding or following the number.

However, the data shows that the sign is not separate. Apparently, the IBM complier will not process that type of data in that type of file.

The only solution I can think of off the top is to define the number as PIC X(14). After reading the record, move the number to a WORKING-STORAGE PIC X(14) field redefined as PIC S9(12)V99.
 
Hi all, thanks for your prompt responses. let me elaborate the whole scenario to a bit detail -

we have RS/6000 servers with Cobol for AIX 1.1. the programs are running smoothly on these machines. Now 2 new servers are purchased: AIX 6 with Cobol for AIX 3.1. i (although a newbie in Cobol) am trying to execute the same applications on the new machine with new cobol compiler. it's generating the aforementioned scenario. I would like get some suggestions --
1. Am i missing some compiler options on the new machine?
2. Is it a rule - a line sequential file must have 'SIGN IS SEPARATE' clause for signed items. then how the old machine is running those programs smoothly?
3. My assumption is that values are ASCII encoded. is it wrong? If not, how to read ASCII encoded values from some input file in Cobol program?
4. Is there any way to ignore the error msg and generate executable?
5. NUMPROC (PFD/NOPFD), CHAR (NATIVE/EBCDIC), COLLSEQ(EBCDIC/NATIVE), CCSID -- are these things creating any difference in this case?
6. On the new machine i am executing the following command -
cob2 -q64 $ORACLE_HOME/precomp/lib/cobsqlintf.o -L$ORACLE_HOME/lib/ -lclntsh -o program program.cbl (ref:
but the older program uses a long command ( with many libraries and compiler options). Is this difference may cause this error?

Thanks in advance
 
Hi Tom,
i have searched the manual of Cobol for AIX 3.1. the term 'binary sequential' is not used there for a single time.

Hi jmanj,

In the file definition, it does not accept 'value zeroes' clause. and treat it as comment. i have tried with -

02 BAM PIC S9(12)V99 SIGN IS TRAILING

it generates the same error mentioned in original post.

Hi werabbit,

can you please elaborate to some extent - the workaround you are mentioning, as i am newbie in cobol.
 
Change the definition
Code:
    02 BAM PIC S9(12)V99.
to
Code:
    02 BAM PIC X(14).
Then, in WORKING-STOREAGE, add
Code:
01  WS-BAMX PIC X(14).
01  WS-BAM9 REDEFINES WS-BAMX PIC S9(12)V99.
Then after you READ the record
Code:
    MOVE BAM TO WS-BAMX.
Thereafter, use WS-BAM9 wherever you would have used BAM.
 
but the older program uses a long command ( with many libraries and compiler options). Is this difference may cause this error?

Yes this can make all the difference.

if you are migrating from one version to the other you will need to keep most of the compiler options if not all.
Most likely one of the options used on the AIX 1.1 compile command is dealing with that particular issue you are having.


Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Hi ferderico,

Thanks for your indication. I tried to execute the long command (converting to oracle path )first but it failed with error messages-

cat: 0652-050 Cannot open /u01/app/oracle/OraHome_1/lib/naldflgs.
PP 5724-V62 IBM COBOL for AIX 3.1.0 in progress ...
LineID Message code Library phase message text
IGYLI0090-W 1 sequence errors were found in this program.
Messages Total Informational Warning Error Severe Terminating
Printed: 1 1
LineID Message code Message text
IGYSC0205-W Warning message(s) were issued during library phase
processing. Refer to the beginning of the listing.
24 IGYGR1213-I The "LABEL" clause was processed as comments for this
file definition.
Same message on line: 39
Messages Total Informational Warning Error Severe Terminating
Printed: 3 2 1
End of compilation 1, program P41051, highest severity: Warning.
Return code 4
ld: 0706-006 Cannot find or open library file: -l sql
ld:eek:pen(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: -l netv2
ld:eek:pen(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: -l nttcp
ld:eek:pen(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: -l network
ld:eek:pen(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: -l ncr
ld:eek:pen(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: -l netv2
ld:eek:pen(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: -l nttcp

FYI, here is the long command -

cob2 $pname2 -q"collseq(ebcdic) " -o $pname /u01/app/oracle/OraHome_1/precomp/lib/cobsqlintf.o /u01/app/oracle/OraHome_1/lib/scorept.o /u01/app/oracle/OraHome_1/lib/sscoreed.o /u01/app/oracle/OraHome_1/rdbms/lib/kpudfo.o -L /u01/app/oracle/OraHome_1/lib/ -lclntsh -lsql -lclntsh /u01/app/oracle/OraHome_1/lib/nautab.o /u01/app/oracle/OraHome_1/lib/naeet.o /u01/app/oracle/OraHome_1/lib/naect.o /u01/app/oracle/OraHome_1/lib/naedhs.o `cat /u01/app/oracle/OraHome_1/lib/naldflgs` -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric -lmm -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric -lplsf -lplsb -lextp -lepc -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lclient -lvsn -lcommon -lgeneric -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lld -lm `cat /u01/app/oracle/OraHome_1/lib/sysliblist` -lm /u01/app/oracle/OraHome_1/lib/libmm.a


can you give me some idea to resolve the library and compiler options issue?

Hi Webrabbit,

I appreciate your idea. I'll try it and will let you know.
 
ok.

Libraries first. It looks to me that you are, even on the old system, linking too many libraries. Normally with oracle you only need
$ORACLE_HOME/precomp/lib/cobsqlintf.o -L$ORACLE_HOME/lib/ -lclntsh
Most of the others you shown on the last cob command will be included automatically by using "-lclntsh"


Objects.

As for these ones - although they not needed on this program you're compiling they may eventually be needed in one other program. Again it is possible these are included on another Oracle library, and if so that library should be used instead
/u01/app/oracle/OraHome_1/lib/scorept.o
/u01/app/oracle/OraHome_1/lib/sscoreed.o
/u01/app/oracle/OraHome_1/rdbms/lib/kpudfo.o
/u01/app/oracle/OraHome_1/lib/nautab.o
/u01/app/oracle/OraHome_1/lib/naeet.o
/u01/app/oracle/OraHome_1/lib/naect.o
/u01/app/oracle/OraHome_1/lib/naedhs.o

As for this one - look at the old machine and see what it contains. something similar may be required on the new one, but I doubt it.
`cat /u01/app/oracle/OraHome_1/lib/naldflgs`


Now regarding the original error. As you noticed, this compile did not issue the error.

I would go back to your original compile line and change it as follows

cob2 -q64 -q"collseq(ebcdic) " $ORACLE_HOME/precomp/lib/cobsqlintf.o -L$ORACLE_HOME/lib/ -lclntsh -o program program.cbl
if it still gives the error please try

cob2 -q"collseq(ebcdic) " $ORACLE_HOME/precomp/lib/cobsqlintf.o -L$ORACLE_HOME/lib/ -lclntsh -o program program.cbl

Would be interested in seeing if they work differently


Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top