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


     
 
MAINFRAME - TIP OF THE DAY : When you use COUNT operator to set a return code of 12 or 4 if a specified data set is EMPTY, NOTEMPTY, HIGHER(n), LOWER(n), EQUAL(n) or NOTEQUAL(n). where n is a specified number of records. If you use the RC4 operand, SORT sets RC=4; otherwise it sets RC=12. E.g. COUNT FROM(IN) EMPTY

Google
 
Web mainframegurukul.com

Split the input file using delimiter and output only few col

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


Joined: 14 Aug 2014
Posts: 4
Location: Chennai

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

PostPosted: Tue Oct 18, 2016 3:37 am    Post subject: Split the input file using delimiter and output only few col Reply with quote

Hi All,

I am trying to read an input file which has a fixed length of 300 bytes and each field in a record are delimited by "|" pipe symbol. For instance

[u]Input file:[/u]

1|232|this is great|chennai|TN|604023|04/12/2018|12321.00|12312.00|N|this is for testing only|external remarks|0|0|3|Y|N|454.00|454.00
1|1232|this is great-o-great|Pune|MA|604023|04/11/2015|321.00|122.01|Y|this is for testing only|external remarks with comments|0|0|4|Y|N|54.00|14.00
1|8059|this is amazing|banglore|KA|298923|28/04/2013|321.00|662.00|N|this is for testing|external remarks|0|0|5|Y|N|344.00|984.00
1|092334|this is outstanding data|Mumbai|MA|23908043|18/08/2016|23321.00|656262.23|Y|this is for purely for testing only|external remarks|0|0|5|N|Y|323.00|1284.00
1|332|this is super|Pune|MA|6023|06/11/2010|9032.12|1233.01|Y|this is for testing only|comments|0|0|5|Y|N|154.00|124.00


I want to include only specific FIXED columns of each record from the input file say 1st, 2nd, 4th, 5th, 6th,9th, 10th, 13th, 14th, 15th in the output file. Is there any option or way to select the records based on the column using the delimiter without fixed length record?

Kindly advice.
_________________
B@L@
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.

balaryan
Member


Joined: 14 Aug 2014
Posts: 4
Location: Chennai

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

PostPosted: Tue Oct 18, 2016 3:47 am    Post subject: Reply with quote

Also I missed one info. Last field in each record will be having either 'Y' or 'N'. Based on the value, if it is 'Y', we should place the record with specific column in output file 1 and if it is 'N' means output file 2.
_________________
B@L@
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.
magesh_j
Member


Joined: 31 Aug 2016
Posts: 16

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

PostPosted: Fri Oct 21, 2016 12:12 am    Post subject: Reply with quote

Yes, Possible using INREC PARSE.

Should your output be without a delimiter or with the delimiter?

If without the delimiter, you want the output of each column to be fixed or variable?
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.
magesh_j
Member


Joined: 31 Aug 2016
Posts: 16

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

PostPosted: Fri Oct 21, 2016 12:13 am    Post subject: Reply with quote

what is the possibility of showing expected output ?
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 -> 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


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