Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Is there a way to store variable outside the code?

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL
  View previous topic :: View next topic  
Author Message
Sandrit
Member


Joined: 11 Sep 2015
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 05, 2015 1:19 am    Post subject: Is there a way to store variable outside the code? Reply with quote

Code:
COMPUTE K215-SUM = K215-FIRST K215-SECOND

IF K215-SUM < 100 AND K100-ACCOUNT-NO = 110 OR 118 OR 120 OR 125 OR 130 OR 132 OR 136 OR 140 OR 148 OR 150 OR 155 OR 156 OR 160 OR 165 OR 168 OR 171 OR 172 OR 175 OR 176 OR 180 OR 185

  MOVE 'Account exist' TO K110-STATE
ELSE
STRING K215-SUM
                  ' To capital accout' INTO K110-MESSAGE-TEXT
END-IF.


It there a way to store the account numbers K100-ACCOUNT-NO somewhere outside the code?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

William Collins
Active Member


Joined: 24 May 2012
Posts: 714

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 05, 2015 11:13 am    Post subject: Reply with quote

If you mean "that big list of literals, so that they don't make the code ugly and more difficult to maintain", then yes.

Code:
05  K100-ACCOUNT-NO PIC 9(3).
    88  K100-ACCOUNT-IS-CLIENT VALUE 110 118 120 125 130 132 136 140 148 150 155 156 160 165 168 171 172 175 176 180 185.


You can make the condition-name (that's what an 88 is) more meaningful (I guessed).

You could also make K100-ACCOUNT-NO a PIC X(3), it does not need to be numeric just because it has numbers in.

You can put the 88 into a copybook of its own, to use it in multiple places without retrying (copybooks can be nested).


Last edited by William Collins on Wed Oct 07, 2015 3:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Torikokillme
Member


Joined: 07 Oct 2015
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Oct 07, 2015 2:32 pm    Post subject: COBOL Reply with quote

The article was written, and can be analyzed in detail. Then the new shares










ibcbet


Last edited by Torikokillme on Mon Feb 01, 2016 1:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
vikriih
Member


Joined: 24 Oct 2015
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 26, 2015 12:47 pm    Post subject: Reply with quote

If you mean outside the program then you can use a sequential file
if you mean outside the procedure division use the 88 level
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
wijnaldumwilliam
Member


Joined: 30 Dec 2015
Posts: 1

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Dec 30, 2015 4:56 pm    Post subject: Reply with quote

It is possible to edit the clipboard and our forum member Prino has provided a macro to do so. Search for it if you are interested. However, IMHO, copying stem variables to clipboard will be a convoluted way to achieve what you are trying to do.

/* Rexx */
/*********************************************************************/
/* */
/* Written Heisei 25.07.09 by Akatsukami-sama. */
/* */
/*********************************************************************/
ADDRESS ISREDIT "MACRO (DSN)"
trace o
sig = x2c("E69989A3A3859540C88589A2858940F2F54BF0F74BF0F940")
sig = sig || x2c("82A840C19281A3A2A49281948960A2819481")
"ALLOC FI(FO) DA('"dsn"') SHR"
"EXECIO * DISKR FO (STEM STEM. FINIS"
"FREE FI(FO)"
address isredit "(L1) = CURSOR"

do i = 1 to stem.0
address isredit "LINE_AFTER &L1 = '"stem.i"'"
l1 = l1 + 1
end

exit

hadoop training in chennai | informatica training in chennai
_________________
http://www.traininginsholinganallur.in/hadoop-training-in-chennai.html
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jan 15, 2016 8:26 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL 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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts COMP-3 TO ALPHANUMERIC MOVE 11 jaydeeppal 24839 Mon Feb 01, 2016 10:08 pm
academyindia4 View latest post
No new posts Copy selected records and move to form a single key. 1 rangab 3705 Sun Jan 16, 2011 11:55 pm
himuengg View latest post
No new posts Move topic from one forum to other.. 5 Anuj Dhawan 6105 Thu Nov 27, 2008 3:55 pm
Anuj Dhawan View latest post
No new posts Why is Group move better than INITIALIZE verb? 1 NiceGuy 5892 Mon Nov 19, 2007 6:52 am
DavidatK View latest post
No new posts query in move COMP value to NUMERIC in easytrieve 2 Avani 6530 Thu Apr 05, 2007 5:00 am
Veera View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7945.html