MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How input is read from SYSIN and assigned to Variable

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
csprakash
Beginner


Joined: 21 Sep 2006
Posts: 9
Topics: 4

PostPosted: Thu Sep 28, 2006 2:49 am    Post subject: How input is read from SYSIN and assigned to Variable Reply with quote

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
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Sep 28, 2006 3:13 am    Post subject: Reply with quote

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 :
Code:

78
ABC

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
csprakash
Beginner


Joined: 21 Sep 2006
Posts: 9
Topics: 4

PostPosted: Thu Sep 28, 2006 3:55 am    Post subject: Reply with quote

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
Code:
ABCD.


i was even able to perform some computations like add, sub,.. but the result was a numeric value.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Sep 28, 2006 5:35 am    Post subject: Reply with quote

csprakash,

Read this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=2099&highlight=numproc

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
csprakash
Beginner


Joined: 21 Sep 2006
Posts: 9
Topics: 4

PostPosted: Mon Oct 02, 2006 10:57 pm    Post subject: Reply with quote

so the same procedure(move) is used to read from sysin.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group