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

SORT JCL - INREC OVERLAY

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
Gurugars
Active Member


Joined: 23 Oct 2010
Posts: 106
Location: Chennai,India.

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

PostPosted: Thu Aug 16, 2012 10:12 pm    Post subject: SORT JCL - INREC OVERLAY Reply with quote

Hi,

I am trying to do - INREC OVERLAY as follows

Code:
//SYSIN    DD *                                       
   INREC IFTHEN=(WHEN=(25,04,CH,EQ,C'0.00'),           
                 OVERLAY=(5:5,20,C'"0.00"',29,35)),   
         IFTHEN=(WHEN=(22,04,CH,EQ,C'0.00'),           
                 OVERLAY=(5:5,17,C'"0.00"',26,35))     
   SORT FIELDS=COPY                                   
//



Input:

Code:
----+----1----+----2----+----3----+----4----+----5----
C01.C03.YRCOMP.0001.0.00."25,000.00"                 
3CR..YRCOMP.0001.0.00."25,000.00"                     


Output:

Code:
----+----1----+----2----+----3----+----4----+----5---
********************************* Top of Data *******
C01.C03.YRCOMP.0001."0.00"0"25,000.00"               

Code:

----+----1----+----2----+----3----+----4----+--
3CR..YRCOMP.0001."0.00"0"25,000.00"           


Could someone please tell me why I'm getting 0 after "0.00"
C01.C03.YRCOMP.0001."0.00"0"25,000.00"

My intention is to change the 0.00 to "0.00" that's it.

I/P info - 80 B, VB file (Tab delimited file)
O/P info - 80B, VB file
_________________
Guru:-)

You're never fully dressed without a smile Smile
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.

DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

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

PostPosted: Fri Aug 17, 2012 12:00 am    Post subject: Reply with quote

Your input does not appear to match the code . . .

Possibly i'm missing something.
_________________
Have a good one
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: Fri Aug 17, 2012 6:16 am    Post subject: Reply with quote

Along with DikDude, I don't see how you get from your input to your output with those cards.

Code:
//SYSIN    DD *                                       
   INREC IFTHEN=(WHEN=(25,04,CH,EQ,C'0.00'),           
                 OVERLAY=(25:C'"0.00"',29)),   
         IFTHEN=(WHEN=(22,04,CH,EQ,C'0.00'),           
                 OVERLAY=(22,C'"0.00"',26))     
   SORT FIELDS=COPY                                   
//


The above should not change the output you get, but there is no reason to change the first portion of your record to its original content. You are "overlaying", so leave the first part of the record alone, put your new zero, then pick up the end of the record - don't specify a length, DFSORT will do "from 29/26 to the end if the record" for you.

You might find a simpler solution with PARSE if you records are tab-delimited.
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.
Gurugars
Active Member


Joined: 23 Oct 2010
Posts: 106
Location: Chennai,India.

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

PostPosted: Fri Aug 17, 2012 12:02 pm    Post subject: Reply with quote

Thanks DickDude and William -

Yes I was doing PARSE only in the OUTREC. But the thing is - my input will be having amount fields, when ever zeros coming as an amount value I will be getting that value as 0.00 but if it is greater than zero it will be "xxxxxx.00". In order to make the parse condition consistent I am doing this INREC OVERLAY.

Please see my input -

Code:
----+----1----+----2----+----3----+----4----+-
********************************* Top of Data
C01.C03.YRCOMP.0001.0.00."25,000.00"         
C01.C03.YRCOMP.0002."25,001.00"."50,000.00"   
C01.C03.YRCOMP.0003."50,001.00"."100,000.00" 


in the first row after 0001 the value came as 0.00, but in the second row the value came as "25,000.00". here I want to make my PARSE condition as a consistent one in all the record where I am doing parse in the outrec.
_________________
Guru:-)

You're never fully dressed without a smile Smile
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: Fri Aug 17, 2012 1:50 pm    Post subject: Reply with quote

At a guess, then, you are getting "25,000.00" because your file is being created as a genuine "comma-seperated" file. The double-quotes "protect" the "," in the number.

This would mean that it is not only zero which will give you a problem, but anything less than 1,000 will, as that will not contain a comma either.

"Something" has then "converted" the comma-separators to tabs and not bothered to remove the double-quotes which no longer have a function.

The "neatest" solution would be to get the creation of the file as genuinely tab-delimited. Tab delimiters are often chosen because the tab character, unlike the comma, is unlikely to genuinely appear in plain text data.

Next "neatest" is to change the definition of the output numeric fields so that they do not include the commas.

Next "neatest" would be to change the "fixer-upper-to-tabs" so that it removes the double-quotes.

Next "neatest" is to use PARSE and deal with the number formats yourself.

On the other hand, if you think about it, if that tab-delimited file was going back into a spreadsheet program, there is no problem with the data content one moment being 10.00 and the next "25,000.00". Are you sure that the data actually causes you a problem, or are you only expecting that?
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.
Gurugars
Active Member


Joined: 23 Oct 2010
Posts: 106
Location: Chennai,India.

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

PostPosted: Fri Aug 17, 2012 3:36 pm    Post subject: Reply with quote

William - Thanks a lot for your time in this.

Yes you are absolutely correct -

Quote:
This would mean that it is not only zero which will give you a problem, but anything less than 1,000 will, as that will not contain a comma either.


I solved this with FINDREP in INREC.!

Code:

//SYSIN    DD *                                     
   INREC IFTHEN=(WHEN=INIT,                         
         FINDREP=(INOUT=(C'"',C'')))                 
   SORT FIELDS=COPY                                 
   OMIT COND=(5,3,CH,EQ,C'IBD')                     
   OUTREC PARSE=(%01=(ENDBEFR=X'05',FIXLEN=04),     
                 %02=(ENDBEFR=X'05',FIXLEN=03),     
                 %03=(ENDBEFR=X'05',FIXLEN=10),     
                 %04=(ENDBEFR=X'05',FIXLEN=04),     
                 %05=(ENDBEFR=X'05',FIXLEN=24),     
                 %06=(ENDBEFR=X'05',FIXLEN=24)),     
   BUILD=(%01,%02,X,%03,%04,X,                       
         %05,SFF,TO=ZD,X,%06,SFF,TO=ZD,80:X),VTOF   



Now I am able to get all the values even which is lesser tahn 1,000

output -
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
********************************* Top of Data ****************************
3CR 3CR NETWTH    0001 000000000000000000000100 000000000000000000200000 
3CR 3CR NETWTH    0002 000000000000000000200100 000000000000000000300000 
3CR 3CR NETWTH    0003 000000000000000000300100 000000999999999999999900 

_________________
Guru:-)

You're never fully dressed without a smile Smile
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.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

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

PostPosted: Fri Aug 17, 2012 8:35 pm    Post subject: Reply with quote

Good to hear it is working - thank you for the followup Smile

d
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: Mon Jan 25, 2016 9:53 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 -> DFSORT , ICETOOL & Utilities 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 Getting no of records in a file 13 Rajapriyaa 14580 Wed Feb 03, 2016 12:44 am
academyindia4 View latest post
No new posts Replacing characters Using JCL 7 rachitsethcse 13827 Wed Feb 03, 2016 12:41 am
academyindia4 View latest post
No new posts Getting Error while using ICEMAN tool 6 giri211 13153 Wed Feb 03, 2016 12:40 am
academyindia4 View latest post
No new posts Calling COBOL from C - getting SOC1 2 balajiiinx 9049 Mon Feb 01, 2016 1:26 am
academyindia4 View latest post
No new posts Easytrieve program for getting Recound counts. 1 prakash.subramaniam 7197 Mon Oct 05, 2009 5:09 pm
Natarajan 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-6723.html