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


     
 
MAINFRAME - TIP OF THE DAY : Q. If there is a situation, where we need to code more than 255 steps in a JOB? A. We need to split jcl into two jcls , at the end of the first jcl check the condition code and initiate the second jcl.

Google
 
Web mainframegurukul.com

Programmers Voted for below topics.      Please Vote for good Posts. Votes Salutes
Topic Title Votes Salutes
SOC 7 abend - interview question 6
splitting of records using cobol 6
HOW TO FIND LINKAGE LENGTH 6
EJECT Verb in COBOL 5
jcl sort to add leading zeroes 5
Infosys Training Program for freshers 5
Changes in copybook 4
IKJ56500I COMMAND DSN NOT FOUND 3
Cobol Multiple Choice Questions By Shravan Wipro 3
Comparing two files 3
What are the issues related with correlated subqueries? 3
VSAM File status 23 ,but records are present in the file 3
what is index or subscript in cobol. please give me brief ex 3
What is the difference between SYNONYM and ALIAS? 1 1
PROCLIB 1 1
sort two files with same sort condition 1 1
What is the difference between Copy and Include? 1 1
EZtrv+ - Is there a way to suppress ez-code from printing... 1 1
Merging two files into one based on certain key fields: 1 1
what is index or subscript in cobol. please give me brief ex 1 1
Copy GDG to GDG (one to one). 1 1
Cobol Multiple Choice Questions By Shravan Wipro 1 1
Hexadecimal to decimal conversion - SORT JCL INREC OUTREC 1 1
jcl sort to add leading zeroes 5
VSAM File status 23 ,but records are present in the file 3
Urgent Help needed !! 3
Hexadecimal to decimal conversion - SORT JCL INREC OUTREC 3
How we can access PDS and its Members thru COBOL ? 3
stored procedure in cobol 2
VERTICAL ARRAY IN CICS 2
what s the difference between DB2 & ADB2? 2
What is auditing? 2
Reg DFSORT utility. 2
Computer based tutorial on IMS DB/DC 2
what is index or subscript in cobol. please give me brief ex 2
How to compare two ps files having millions of records ? 2
Cobol Multiple Choice Questions By Shravan Wipro 2
SOC 7 abend - interview question 2
How to read HEX file and convert it into decimal in REXX. 2
Various Locking mechanism for cursors and other SQL? 2
How to fetch and compare the system date in JCL 2
Comparing 2 files based on Acct number without using tables 1
JCL-I need to FTP from MF to Local computer 1
cics 1
sort two files with same sort condition 1
U4093 IMS Abend 1
writing 2 records for each qualifying input record. 1
Is it possible to get last modified date of PDS members... 1
Merging two files into one based on certain key fields: 1
How to run only 2 steps out of 100 steps??? 1
Corresponding statement 1
Difference between an Object Module and Load Module 1
Moving cursor to next field in ISPF dialog 1
DB2 query !! 1
JCL Interpreter :?: 1
Comparing Date with current date 1
SORT verb - help 1
How to assign System Date/Time to a parameter in a JCL pgm? 1
is the answer correct?? 1
Mainframe Developer Requirement - Coimbatore 1
Man of the year 1
I need to FTP from MF to UNIX 1
Control flow from one STEP to another 1
How to convert Julian date format into yyyymmdd date format? 1
What is the difference between Static and Dynamic Binding? 1
In jcl please help me. 1
Access DB2 region using rexx 1
DFHAC2016 - Trans XXXX cannot run because program XXX is Not 1
EZtrv+ - Is there a way to suppress ez-code from printing... 1
How to use XREF.. 1
DB2 checkpoint-restart doubts 1
Problem with numeric field with sign in last digit

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> EASYTRIEVE
  View previous topic :: View next topic  
Author Message
cees post
Member


Joined: 26 Mar 2007
Posts: 2
Location: Amsterdam

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

PostPosted: Tue Apr 03, 2007 2:24 pm    Post subject: Problem with numeric field with sign in last digit Reply with quote

Field definition input

P1 1 6 N
Value of field is 02236A

Field definition of output
S1 1 1 A
N1 2 6 N

I want the value 022361 by processing as follows
IF P1 < 0
S1 = '-'
N1 = (P1 * -1)
ELSE
N1 = P1
END-IF

But when I proces this field I get
*******A006 PROGRAM INTERRUPT - CODE 7 (DATA EXCP)

Somebody how knows how to handel these kind of fields in easytrieve program
_________________
With kind regards
Cees Post
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.

Krishna
Site Admin


Joined: 27 Jan 2006
Posts: 1044

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

PostPosted: Tue Apr 03, 2007 9:37 pm    Post subject: EASYTRIEVE - MASK Reply with quote

Hi Cees,

What is the value of P1? Is it 02236A or 022361.

If you want to display sign '-' , you can use MASK while defining
target variable. It is not required to multiply with -1.

Code:


 S1    W  7 N 0 MASK('-----99')
 
 OR

 S2    W  7 N 0 MASK('ZZZZZ9-')




Let me know, if this is not answered your question.


Regards,
Krishna
http://www.geocities.com/srcsinc
http://www.ibmmainframeguru.com
http://www.jacharya.com
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
cees post
Member


Joined: 26 Mar 2007
Posts: 2
Location: Amsterdam

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

PostPosted: Wed Apr 04, 2007 11:34 am    Post subject: Re: EASYTRIEVE - MASK Reply with quote

Hi Krishna,

As I understand mask is only working when you display it in a report.

What I want is to write a numeric field with a character at the end (representing a sign) to a output file, so in my example is the input P1 value 02236A (where A is standing for -1) and I expect in my output file the value -022361

Thanks for your help
_________________
With kind regards
Cees Post
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.
Krishna
Site Admin


Joined: 27 Jan 2006
Posts: 1044

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

PostPosted: Wed Apr 04, 2007 6:50 pm    Post subject: easytrieve MASK Reply with quote

Hi Cees,

Try with
P1 1 6 N 0 <- Add zero at the end of declaration.

or

Use MASK
_________________
Regards,
Krishna
Facebook --> http://www.facebook.com/mainframegurukul
Connect with RAMESH KRISHNA REDDY --> http://www.linkedin.com/in/rameshkrishnareddy
Twitter --> https://twitter.com/mainframegurkul
http://www.mainframetutorials.com


Last edited by Krishna on Thu Apr 05, 2007 12:54 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

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

PostPosted: Thu Apr 05, 2007 12:46 am    Post subject: Reply with quote

Cees Post,

I am not clear on few things on ur requirement,


1) P1 1 6 N
Value of field is 02236A ---> How can a variable declared (N ->Numeric) has a alpha numeric value


2) As per ur given data P1 = 02236A

and what are you tryinG to achieve by doing this

N1 = (P1 * -1) ===> you mean N1 = 02236A * (-1) ?????

Well i am not sure what is your requirement correctrly.


But i assumed few things and coded a sample program which will give you what you have asked for in the outputfile, please find below


Code:
 PARM  ABEXIT(SNAP) PRESIZE 1024                                         
*                                                                       
FILE INPFILE FB (6 0)                                                   
  INPFILE-FIELD          1   6 A   ---------------------> I/P FILE HAS A VALUE OF 02236A                                     
*                                                                       
FILE OUTFILE  FB (7 0)                                                 
 WS-OUTFILE-REC          1   7 A   ---------------------> Expected O/P FILE SHOULD VALUE OF  -022361                                                                         
*                                                                       
WS-INPFILE-FIELD         1   6 A                                       
    WS-INP-VALUE         1   5 N                                       
    WS-INP-SIGN          6   1 A   

*                                                                       
 WS-INP-VALUE-A          1   6 N 0                                     
*                                                                       
 WS-OUTFILE-FIELD        1   7 A                                       
    WS-OUT-SIGN          1   1 A                                       
    WS-OUT-VALUE         2   6 N                                       
*                                                                       
********************************************************************** 
*                          PROCESSING                                * 
********************************************************************** 
*                                                                       
JOB INPUT (INPFILE)                                                     
*                                                                       
    WS-INPFILE-FIELD    =  INPFILE-FIELD                               
    WS-INP-VALUE-A      = (WS-INP-VALUE * (-10)) - 1                   
*                                                                       
    IF WS-INP-VALUE-A   LT 0                                           
       DISPLAY ' LESS THAN ZERO '                                       
       WS-OUT-SIGN      = '-'                                           
       WS-OUT-VALUE     = (WS-INP-VALUE * 10) + 1                       
       WS-OUTFILE-REC   = WS-OUTFILE-FIELD                             
       PUT  OUTFILE                                                     
    ELSE                                                               
       DISPLAY ' GREATER THAN ZERO '                                   
       WS-OUT-SIGN      = '+'                                           
       WS-OUT-VALUE     = (WS-INP-VALUE * 10) + 1                       
       WS-OUTFILE-REC   = WS-OUTFILE-FIELD                             
       PUT  OUTFILE                                                     
    END-IF                                                     



NOTE : IN THE ABVOE CODE I ASSUME THE VALUE OF A = -1 AND DID THE CODING, IF YOUR REQUIREMNT IN THAT I/P FILE WILL HAVE HEX VALUES FROM 0 -9 , A,B,C,D,E,F,G,H....YOU NEED TO VALIDATE THOSE
AND MOVE THE CORESPONDING VALUES INSTEAD OF -/+ 1 AND -/+ 10...ACCORDINGLY.

P.S = I AM NOT 100% CLEAR REG UR REQUIREMENT, I GUESS I TRIED TO PUT THE CODE THE WAY YOU HAVE TRIED , IF YOU COME UP WITH CLEAR REQUIREMETNS REG THE FILE LAYOUT AND WHAT KIND OF VARAIBLE/DATA COMES FROM I/P FILE MAY BE YOU DONT NEED THE ENTIRE CODE ..A TRICKY DECLARATION OF THE VARAIBLE CAN DO ..THE WORK ...

Thanks,
Veera.
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.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> EASYTRIEVE 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 how to read and write only first & last records of a fil 8 Subha 8568 Fri Jul 15, 2011 5:15 pm
Subha View latest post
No new posts I need a JCL to delete the last 6 lines of all the members i 3 osurendhra 14765 Tue Mar 30, 2010 1:39 pm
Anuj Dhawan View latest post
No new posts Need to keep only the last records for a certain group 7 rbowers 3879 Mon Feb 01, 2010 10:26 pm
Frank Yaeger View latest post
No new posts Sort file by groups, keeping only the last group 7 TamiAZ 6353 Fri Oct 02, 2009 11:24 am
TamiAZ View latest post
No new posts removing the duplicate record and picking up the last entery 2 pinaki_atha 6510 Fri Nov 10, 2006 3:18 am
Frank Yaeger 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-2397.html