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


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

COBOL MOVE CORRESPONDING DOUBT
Goto page 1, 2  Next
 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL
  View previous topic :: View next topic  
Author Message
perumalnk
Member


Joined: 28 Feb 2008
Posts: 24
Location: Denver,USA

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

PostPosted: Thu Aug 12, 2010 8:26 am    Post subject: COBOL MOVE CORRESPONDING DOUBT Reply with quote

Hi,

Wishes !

I have a tiny doubt in COBOL "MOVE CORRESPONDING" working. Please find below my scenario,

Layout#1:

01 WS-LAYOUT-1
05 WS-MOVE-1
10 WS-FIELD-1 PIC X(02).
10 WS-FIELD-2 PIC S9(09) COMP-3.

Layout#2:

01 WS-LAYOUT-2
05 WS-MOVE-2
10 WS-FIELD-1 PIC X(02).
10 WS-FIELD-2 PIC 9(07).

With this layouts,when I execute the below statement,

MOVE CORRESPONDING WS-MOVE-1 TO WS-MOVE-2

Whether WS-FIELD-2 from input layout will get moved to output layout or not?

Thanks in advance !

Thanks,
Perumal.N.K.
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.

Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Thu Aug 12, 2010 2:41 pm    Post subject: Reply with quote

Why not just try this out?

PS. you need period (.) after 01 and 05 levels.
_________________
Regards,
Anuj
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.
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 981

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

PostPosted: Thu Aug 12, 2010 3:04 pm    Post subject: Reply with quote

perumalnk wrote:
I have a tiny doubt...


funny, nearly all your posts sound the same.
you are just to lazy to read the manual.

explanation which will remove all doubts
_________________
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

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

PostPosted: Thu Aug 12, 2010 4:00 pm    Post subject: Reply with quote

My guess is it should move the values from input WS-FIELD-2 to output WS-FIELD-2.
_________________
Natarajan
Chennai
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.
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 981

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

PostPosted: Thu Aug 12, 2010 4:14 pm    Post subject: Reply with quote

Natarajan wrote:
My guess is it should move the values from input WS-FIELD-2 to output WS-FIELD-2.


yes, it will be a conversion move.
_________________
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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.
perumalnk
Member


Joined: 28 Feb 2008
Posts: 24
Location: Denver,USA

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

PostPosted: Fri Aug 13, 2010 2:43 pm    Post subject: Reply with quote

Hi All,

Thanks for the reply.

I did try that out. It got moved , but initially I thought it will not get moved as the declarations differ. So just to confirm my understanding, I asked this doubt. Sorry that it bothered much.
The WS-FIELD-2 of input layout comes from an IMS DB.Now when I changed the output layout WS-FIELD-2 declaration to S9(9) comp-3, I faced S0C7 abend at the move. For the same segment values when I declare my output WS-FIELD-2 as 9(Cool,job goes through fine !

Thanks,
Perumal.N.K.
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.
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 981

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

PostPosted: Fri Aug 13, 2010 2:58 pm    Post subject: Reply with quote

Quote:
I faced S0C7 abend at the move


**sigh** the SOC7 indicates that you have non-numerics in a numeric field.

all you have managed to do is just propogate the garbage thru your program,
instead of taking an exception routine,
denoting the problem - and the values,
substituting appropriate default values or
doing something to tell someone that their is garbage in the system.

do you work for the government?
_________________
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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.
perumalnk
Member


Joined: 28 Feb 2008
Posts: 24
Location: Denver,USA

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

PostPosted: Fri Aug 13, 2010 3:51 pm    Post subject: Reply with quote

Hi Dick Brenholtz,

Those are new fields added in a segment and they might be hoding low values for the existing entries in the DB. I understand that is the reason for S0C7. I just wonder why is the data exception abend is not occuring when I use 9(Cool? I expect the S0C7 abend when use the same data with the declaration of 9(Cool. Hope my doubt is clear to you now.

I dont work for govt.

Thanks,
Perumal.N.K.
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.
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 981

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

PostPosted: Fri Aug 13, 2010 4:12 pm    Post subject: Reply with quote

PIC 9n display/PIC S9n display is for all-intents-and-purposes - alphanumeric,
which allows you to stuff any garbage into the field
with the added feature that you can perform arithmetic with the field.

IMUO:
move corr should not be used and most site standards don't allow it.
it only saves in the coding, as the generated code is still single moves.

i believe that you should always maintain numeric values in pure numeric fields (comp, comp-3)
which helps remove garbage from the data flow.
you could have tested for low-values and moved zero to a comp-3 field.
_________________
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Fri Aug 13, 2010 4:57 pm    Post subject: Reply with quote

Not sure if I've missed something but just a COBOL MOVE will not cause a S0C7 unless you use the "target (non-numeric)" field in Arithmetic-calculations. Just after MOVE DISPLAY both the variables and you should be having a hint of what's happeing.
_________________
Regards,
Anuj
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.
perumalnk
Member


Joined: 28 Feb 2008
Posts: 24
Location: Denver,USA

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

PostPosted: Mon Aug 16, 2010 2:15 pm    Post subject: Reply with quote

Hi Dick Brenholtz,

Thanks for clarifying the reason behind the S0C7 when the variable is declared as PD. I was wondering the reason behind it.

Yeah, as MOVE CORRESPONDING was used already at that place, we did not get the drive to make an explicit check for low values.

Thanks again.

Thanks,
Perumal.N.K.
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Mon Aug 16, 2010 4:02 pm    Post subject: Reply with quote

COMP-3, yeah - it'll casue S0C7. Thanks Dick.

Please disregard my previous post Embarassed.
_________________
Regards,
Anuj
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.
academyindia4
Guest





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

PostPosted: Wed Jan 27, 2016 8:30 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.
academyindia4
Guest





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

PostPosted: Mon Feb 01, 2016 10:18 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.
academyindia4
Guest





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

PostPosted: Mon Feb 01, 2016 10:23 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
Goto page 1, 2  Next
Page 1 of 2



 
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


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-5268.html