Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Beginner PLI problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
santhosh.kumar.vj

New User


Joined: 03 Aug 2011
Posts: 8
Location: Bangalore

PostPosted: Wed Sep 21, 2011 8:04 pm    Post subject: Beginner PLI problem
Reply with quote

i am a very new to PLI. i have just coded a sample program to get data from SYSIN and to display this.

Here is my sample program.

But still its throwing an abend soc4. Could anyone help me to solve this error?


MADHAN:PROCEDURE OPTIONS(MAIN);
DCL X CHAR(4);
GET LIST(X);
PUT LIST(X);
END P3;


JCL:

000810 //SYSIN DD *
000820 X='ABCD';
000830 /*
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Sep 21, 2011 8:16 pm    Post subject: Reply to: HELLO
Reply with quote

HELLO to You

my usual suggestion when I see such poorly worded topics...

to make the most out of the questions You ask and to forecast the comments You might receive
it would be wise for You to read and meditate on
how to ask questions the smart way
here http://catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here http://support.microsoft.com/kb/555375
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Sep 21, 2011 8:49 pm    Post subject: Re: Beginner PLI problem
Reply with quote

santhosh.kumar.vj wrote:
i am a very new to PLI. i have just coded a sample program to get data from SYSIN and to display this.

Here is my sample program.

But still its throwing an abend soc4. Could anyone help me to solve this error?


Code:
MADHAN:PROCEDURE OPTIONS(MAIN);
DCL X CHAR(4);
GET LIST(X);
PUT LIST(X);
END P3;

(Code tags added.)

This code will in fact generate a compile-time error. Please determine why and correct it; we will then talk further,
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Wed Sep 21, 2011 8:52 pm    Post subject:
Reply with quote

One problem you have is your END statement - the label (P3) does not match that on your PROC (MADHAN)
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 22, 2011 7:06 am    Post subject:
Reply with quote

Don't you want GET DATA (and if you wish also PUT DATA)?
Back to top
View user's profile Send private message
santhosh.kumar.vj

New User


Joined: 03 Aug 2011
Posts: 8
Location: Bangalore

PostPosted: Thu Sep 22, 2011 11:25 am    Post subject: Reply to: Beginner PLI problem
Reply with quote

Thanks for your advice

i have corrected it, still am getting same SOC4 ABEND When i pass values through sysin

here is my sample code and
run program
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Thu Sep 22, 2011 11:34 am    Post subject:
Reply with quote

Declare A as CHAR(80)
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 22, 2011 5:43 pm    Post subject:
Reply with quote

Gnana -

I do not see why making A char(80) solves the problem. User clearly is inputting 3 chars.

Please explain.
Back to top
View user's profile Send private message
santhosh.kumar.vj

New User


Joined: 03 Aug 2011
Posts: 8
Location: Bangalore

PostPosted: Thu Sep 22, 2011 6:40 pm    Post subject: Reply to: Beginner PLI problem
Reply with quote

Hi


problem is not yet solved.can some one tell me how to use 'DATA'.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Sep 22, 2011 11:56 pm    Post subject: Re: Reply to: Beginner PLI problem
Reply with quote

santhosh.kumar.vj wrote:
Hi


problem is not yet solved.can some one tell me how to use 'DATA'.

Please post (cut-and-paste surrounded by code tags; do not attach screen shots) the run JCL, the relevant portions (i.e., the abend message(s)) of the JES message log, and the LEMSG sysout.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Fri Sep 23, 2011 12:43 am    Post subject:
Reply with quote

The format of your input data is for GET DATA processing not GET LIST. For GET LIST you supply the data only whereas for GET DATA you supply the entire assignment statement. If you look in the PL/1 Language Reference manual and look at the index for GET you can jump to the relevant sections of the manual.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Fri Sep 23, 2011 3:36 pm    Post subject:
Reply with quote

Hi Phrzby,

I thought, GETting SYSIN of 80 bytes into CHAR(7) might cause an error, but it is not.

Sorry about that.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Sep 23, 2011 10:58 pm    Post subject:
Reply with quote

Gnana Sekaran Nallathambi wrote:
Hi Phrzby,

I thought, GETting SYSIN of 80 bytes into CHAR(7) might cause an error, but it is not.

Sorry about that.

You're not GETting 80 bytes, you're GETting the length of the actual data in SYSIN. "A='MAD'" has a length of 3, not 7 or 80.

Incidentally, I am fairly confident that the TS is not getting a "SOC4" (sic) abend, although he is likely getting a variety of other errors that, like a S0C4 abend, are intercepted by LE causing it to issue a U4038 abend.

(Even more incidentally: I don't recall anyone ever asking "What is a SOC4?" You may be sure, however, that when someone does ask that, I will fight to be first with the reply "It's for keeping your foot warm and dry" icon_biggrin.gif)
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 23, 2011 11:12 pm    Post subject: Reply to: Beginner PLI problem
Reply with quote

Hi Akatsumi,

Quote:
I don't recall anyone ever asking "What is a SOC4?"
Once upon a tme, these were not as common as they are today. In those days (early 70's), the only s0c4's i remember happened with programs that interfaced to TCAM (predecessor to VTAM). In those days, there were few organizations that had anything "online", so it was all new to most everyone.

When a programmer was called by Operations that their program had blown up, they'd come to the computer room to pick up the available info. Seeing the abend, they'd often call out "What's a S0C4?" and several of the operators (in chorus) would yell back your answer icon_smile.gif

d
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Sat Sep 24, 2011 2:17 am    Post subject:
Reply with quote

Compiles, Links and Gos with rc=0 for all 3 steps IF the change I referred to re the end label is made and DATA is used rather than LIST. TS has not come bck for a bit - maybe he got it going and was so excited that he forgot to thank us icon_rolleyes.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Sat Sep 24, 2011 2:22 am    Post subject:
Reply with quote

Nic Clouston wrote:
Compiles, Links and Gos with rc=0 for all 3 steps IF the change I referred to re the end label is made and DATA is used rather than LIST. TS has not come bck for a bit - maybe he got it going and was so excited that he forgot to thank us icon_rolleyes.gif

Oh, he'll be back...if he ever tries to write another line of PL/I icon_razz.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm
No new posts TXT2PDF problem - printing @ in PDF vipul65 All Other Mainframe Topics 9 Thu Aug 25, 2016 12:48 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us