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
 

 

Input at cobol end from Jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
RahulChaudhari

New User


Joined: 03 Nov 2010
Posts: 11
Location: India

PostPosted: Tue Nov 16, 2010 7:03 pm    Post subject: Input at cobol end from Jcl
Reply with quote

If we initialize a numeric value (9(2) pic variable) to be alpha bate it throws an error instantly.
I am passing a alpha bate value to a 9(2) pic variable through JCL it doesn't throws any error/abend and any computation on that variable gives a numeric value as output.
plz look at the program below it will give you clear picture what I mean to say.
can you tell me how the JCL input is recognizing at cobol end.does it converts the input into EBCDIC/hex/binary or what else?
how the output for n2 comes as 09?


DATA DIVISION.
WORKING-STORAGE SECTION.
01 FS1 PIC 9(2).
77 NUM PIC S9(4) VALUE +1234.
77 NUM5 PIC 9(3).
77 NUM1 PIC S9(4) SIGN LEADING VALUE +1234.
77 NUM2 PIC S9(4) USAGE COMP-5 VALUE -32767.
77 NUM3 PIC S9(4) USAGE COMP-4 VALUE -9999.
77 NUM4 PIC S9(4) USAGE COMP-3 VALUE -9999.
77 NUM6 PIC X(10).
77 N1 PIC 9(2).
77 N2 PIC 9(2).
PROCEDURE DIVISION.
ACCEPT N1.
COMPUTE N2 = N1 - 1.
DISPLAY 'N1=' N1.
DISPLAY 'N2=' N2.
MOVE NUM4 TO NUM6.
DISPLAY NUM6.
DISPLAY NUM " THIS IS VALUE FOR SIGN TRAILING +1234".
DISPLAY NUM1 " THIS IS VALUE FOR SIGN LEADING +1234".
DISPLAY NUM2 " THIS IS MAX VALUE FOR COMP-5 WITH S9(4) PIC".
DISPLAY NUM3 " THIS IS MAX VALUE FOR COMP-4 WITH S9(4) PIC".
DISPLAY NUM4 " THIS IS MAX VALUE FOR COMP-3 WITH S9(4) PIC".
STOP RUN.



Jcl For above program.

//STEP01 EXEC PROC=IGYWCLG
//COBOL.SYSIN DD DSN=VS90609.TEST(COB1),DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//GO.SYSIN DD *
A
/*
//

Output:

N1=A
N2=09
9999
123D THIS IS VALUE FOR SIGN TRAILING +1234
A234 THIS IS VALUE FOR SIGN LEADING +1234
3276P THIS IS MAX VALUE FOR COMP-5 WITH S9(4) PIC
999R THIS IS MAX VALUE FOR COMP-4 WITH S9(4) PIC
999R THIS IS MAX VALUE FOR COMP-3 WITH S9(4) PIC
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Nov 16, 2010 8:02 pm    Post subject:
Reply with quote

1. the accept loaded 2 char C140 (A )

which is 10, and minus 1 = 9.


2. 77 NUM PIC S9(4) VALUE +1234. is not sign trailing. old days we call this an overprint or overpunch sign.

the time it took to create this post would have been better spent reading a manual or two.
Back to top
View user's profile Send private message
RahulChaudhari

New User


Joined: 03 Nov 2010
Posts: 11
Location: India

PostPosted: Wed Nov 17, 2010 2:20 pm    Post subject: plz give explznztion to C140
Reply with quote

hi,
Dick Brenholtz

77 N1 PIC 9(2).
accept n1.

//go.sysin *
A
/*


the accept loaded 2 char C140 (A ) what do u mean to say by C140 sorry cant understand plz explain.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Nov 17, 2010 2:56 pm    Post subject:
Reply with quote

you ACCEPTed 2 char (9(2)) - and since display numeric is almost alphanumeric, your accept statement loaded 2 char into your N1 variable.
an A - hex C1
and a space - hex 40

and since the numeric portion of display numeric will ignore the high-order bits, a C140 is treated by the COMPUTE statement as F1F0.

if I were you, I would be careful using color and size attributes,
they only emphasize your ignorance.

RTFM Read The Fine Manual
Back to top
View user's profile Send private message
RahulChaudhari

New User


Joined: 03 Nov 2010
Posts: 11
Location: India

PostPosted: Wed Nov 17, 2010 3:27 pm    Post subject:
Reply with quote

hi,
Dick Brenholtz

thank you for your help.
i will be very conscious while using color & font from now onwards.
thanx.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am


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