IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Beginner PLI problem


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Sep 21, 2011 8:16 pm
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 catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here support.microsoft.com/kb/555375
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Sep 21, 2011 8:49 pm
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: 2455
Location: Hampshire, UK

PostPosted: Wed Sep 21, 2011 8:52 pm
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

Senior Member


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

PostPosted: Thu Sep 22, 2011 7:06 am
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
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: 792
Location: Chennai, India

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

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

Senior Member


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

PostPosted: Thu Sep 22, 2011 5:43 pm
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
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: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 22, 2011 11:56 pm
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: 2455
Location: Hampshire, UK

PostPosted: Fri Sep 23, 2011 12:43 am
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: 792
Location: Chennai, India

PostPosted: Fri Sep 23, 2011 3:36 pm
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: 1788
Location: Bloomington, IL

PostPosted: Fri Sep 23, 2011 10:58 pm
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

Moderator Emeritus


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

PostPosted: Fri Sep 23, 2011 11:12 pm
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: 2455
Location: Hampshire, UK

PostPosted: Sat Sep 24, 2011 2:17 am
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: 1788
Location: Bloomington, IL

PostPosted: Sat Sep 24, 2011 2:22 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top