View previous topic :: View next topic |
Author |
Message |
csprakash Beginner
Joined: 21 Sep 2006 Posts: 9 Topics: 4
|
Posted: Thu Sep 28, 2006 2:49 am Post subject: How input is read from SYSIN and assigned to Variable |
|
|
hai all,
01 AA PIC 9999.
01 BB PIC XXXX.
when i gave input to these variables how it will read and places into the variable ie., in memory
in input is
//SYSIN DD *
78
abc
/*
i got both the datatype(numeric & Alphanumeric) being placed from the left side ie., if memory location for AA it got storead as
78--(9999) not as --78(9999)
same for the alphanumeric varible
does cobol sees any difference for numeric and alpanumeric like C,C++ or it wont. |
|
Back to top |
|
|
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Thu Sep 28, 2006 3:13 am Post subject: |
|
|
csprakash,
Whenever you pass data using SYSIN DD * in JCL and when u read the data in the Program using ACCEPT statement it reads from COL1 left to right that is why u are getting output as :
_________________ Shekar
Grow Technically |
|
Back to top |
|
|
csprakash Beginner
Joined: 21 Sep 2006 Posts: 9 Topics: 4
|
Posted: Thu Sep 28, 2006 3:55 am Post subject: |
|
|
shekar,
i cant get u ie.,
when it read from 1st col it assigns to the variables starting memory location to the end. (byte by byte)
ie., ACCPET simply read a record (a line) and assigns to the given variable, when multiple variables are given it assigned according to the size(memory).
it wont check the type of the data whether is numeric or alphanumeric
i was also able to read alphanumeric values into numeric values and was able to display the same alphanumeric data
EG:
Code: |
//SYSIN DD *
ABCD
/* |
COBOL
Code: | 01 AA PIC 9999.
.
ACCEPT AA.
DISPLAY AA.
. |
output is
i was even able to perform some computations like add, sub,.. but the result was a numeric value. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
csprakash Beginner
Joined: 21 Sep 2006 Posts: 9 Topics: 4
|
Posted: Mon Oct 02, 2006 10:57 pm Post subject: |
|
|
so the same procedure(move) is used to read from sysin. |
|
Back to top |
|
|
|
|