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

String Comparision with multiple condition

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


Joined: 02 Feb 2016
Posts: 2

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

PostPosted: Tue Feb 02, 2016 9:47 pm    Post subject: String Comparision with multiple condition Reply with quote

I want to write a Sort card to extract record having name field value( last_Name or First_Name) only one or two character, We need to consider Space as well. The requirement i have tried to show in the form of Input and output file

The field Length is 40 and record length 1000(FB)

Input:
last_Name, First_Name
1) Rahul, Kumar
2) Rahul, A
3) Rajesh,B N
4) Suresh, B Y
5) AM, Tomeu

Output:
1) Rahul, A
2) Rajesh,B N
3) Suresh, B Y
4) AM, Tomeu
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: Tue Feb 02, 2016 11:02 pm    Post subject: Reply with quote

So, when the first-name is an initial or the last-name is two characters, you want to extract?
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 Feb 03, 2016 12:37 am    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.
rakeshverma060
Member


Joined: 02 Feb 2016
Posts: 2

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

PostPosted: Wed Feb 03, 2016 6:35 am    Post subject: Reply with quote

[quote="William Collins"]So, when the first-name is an initial or the last-name is two characters, you want to extract?[/quote]


We need to compare the string "," in the name record. If the first name or the last name is having single or double character after or before the string "," then we have to fetch the record.
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: Wed Feb 03, 2016 4:19 pm    Post subject: Reply with quote

The fact that you show data which is irregular implies that you have to deal with anything being irregular with your name data.

This would include a comma being missing, and if there is a comma in the data following, that will cause you problems.

So, first use OVERLAY to relocate your 40-byte field to a temporary extension to the record.

Then use PARSE to create two PARSEd fields, with ABSPOS=1001 to look only at your extended data.

Use ENDBEFR=C',' for the first PARSEd field, FIXLEN=40, and use FIXLEN=40 for the second PARSEd field.

Further extend the record to include the two PARSEd fields. Use JFY with SHIFT=LEFT on both fields.

If the second PARSEd field is entirely blank, there is either no comma or no first name. What do you want to do with that?

You can then test the second or third byte of the first PARSEd field for blank. Test the second byte of the second PARSEd field for blank. This can be on INCLUDE= on OUTFIL, then BUILD=(1,1000) to drop off the extensions to the record.
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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts To copy a load module mem from one pds to another thru rexx 6 meena_cts 12569 Mon Feb 01, 2016 10:55 pm
academyindia4 View latest post
No new posts Control flow from one STEP to another 9 pkaushi 29496 Mon Feb 01, 2016 10:55 pm
academyindia4 View latest post
No new posts Copy GDG to GDG (one to one). 6 arrbee 20212 Mon Feb 01, 2016 10:54 pm
academyindia4 View latest post
No new posts CICs 7 vidhya 22155 Mon Feb 01, 2016 10:47 pm
academyindia4 View latest post
No new posts A Really Nice One. Don't Miss the Moral. 0 arrbee 8147 Thu Mar 09, 2006 7:51 pm
arrbee 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-8258.html