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

 MAINFRAME - TIP OF THE DAY : programming pearls - Good judgement comes from experience, and experience comes from bad judgement.

 Web mainframegurukul.com

Programmers Voted for below topics.      Please Vote for good Posts. Votes Salutes
Author Message

Member

Joined: 30 Aug 2011
Posts: 1
Location: India

 0 salutes

Posted: Tue Sep 13, 2011 5:51 am    Post subject: Splitting the Numbers alone from a given variable

I have a task in which we have to spilt the Variable into two .

The length of the address 2 variable is X(32)

in this case its starting position is 42 .

i have an input file which looks like this
 Code: Account number        address line 1              address line 2 123456789              velan nagar               chennai12345 123456453              mahalakshmi st          delhi5678 012345653              brindhavan nagar        mumbai45678

I have to spilt the Address line 2 into two . say that the numbers in the adress line 2 represents pincode. I have to spilt that from the above scenario and should be displayed after two blanks.

The desired output will look like this

 Code: Account number        address line 1              address line 2 123456789                veloan nagar               chennai              12345 123456453                 mahalakshmi st          delhi                   5678 012345653                 brindhavan nagar        mumbai                  45678

I tried in cobol by calculating the length of the variable and using inspect just want to know is there a way to figure this out in DFSORT or SYNCSORT.

Karthik. G
_________________
Thanks and Regards,

Karthikeyan Gunasekaran
 <-- Click on right mark icon. If this post answer your question.

Moderator

Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

 0 salutes

Posted: Tue Sep 13, 2011 10:12 pm    Post subject:

You can use a DFSORT job like the following to do what you asked for. Adjust FIXLEN accordingly for the maximum length of the two fields to be split.

 Code: //S1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * 123456789              velan nagar       chennai12345 123456453              mahalakshmi st    delhi5678 012345653              brindhavan nagar  mumbai45678 //SORTOUT DD SYSOUT=* //SYSIN DD *   OPTION COPY   INREC PARSE=(%01=(ABSPOS=42,      ENDBEFR=C'0',ENDBEFR=C'1',ENDBEFR=C'2',      ENDBEFR=C'3',ENDBEFR=C'4',ENDBEFR=C'5',ENDBEFR=C'6',      ENDBEFR=C'7',ENDBEFR=C'8',ENDBEFR=C'9',FIXLEN=25),        %02=(FIXLEN=10)),      BUILD=(1,41,%01,%02) /*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
 <-- Click on right mark icon. If this post answer your question.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT + 5 Hours Page 1 of 1

 Jump to: Select a forum This Website----------------Admin AnnouncementsModerators Only APPLICATION PROGRAMMING----------------COBOLJCLDFSORT , ICETOOL & UtilitiesCICSEASYTRIEVE DATA MANAGEMENT SYSTEMS----------------DB2 SQL - DB2 PROGRAMMINGVSAM - File systemIMS DBIDMS TOOLS----------------XPEDITERFILE-AIDCHANGE MANENDEVOR, COOLGEN , PANVALET and CA-7 OTHER LANGUAGES----------------TSO, CLIST & REXXPL/IASSEMBLERIMS/DC CAREERS / JOBS DISCUSSIONS / INTERVIEW QUESTIONS----------------JOB VACANCIESJOB DISCUSSIONABEND CODES / ERROR CODESDB2 INTERVIEW QUESTIONSCOBOL INTERVIEW QUESTIONSJCL INTERVIEW QUESTIONSVSAM INTERVIEW QUESTIONSCICS INTERVIEW QUESTIONSINTERVIEW QUESTIONS OTHER MAINFRAME SUBJECTS----------------XMLMQSERIES & WEBSPHEREOTHER SUBJECTS GENERAL FORUMS----------------EntertainmentGeneral DiscussionPersonality DevelopmentOff TopicsSuggestions & Feedback
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

  Topics   Replies   Author   Views   Last Post Related topics EZtrv+ - Is there a way to suppress ez-code from printing... 5 seagreg 11284 Mon Feb 01, 2016 1:39 amacademyindia4 Reg DFSORT utility. 5 ursvmg 18022 Mon Feb 01, 2016 1:38 amacademyindia4 Special Char ~ is not displayed in SYSOUT 1 raulravi 711 Thu Mar 27, 2014 11:36 pmDikDude How to change the job name displayed in the spool. 2 hnharish 4474 Tue Mar 23, 2010 2:28 pmAnuj Dhawan Limit of threads to be displayed on one web page ? 3 Anuj Dhawan 2616 Sun Mar 15, 2009 10:43 amAnuj Dhawan

 Cobol TutorialThis cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3..... DB2 TutorialDB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters CICS TutorialThis CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming... JCL TutorialThis is most popular JCL tutorial from mainframegurukul. It does contain important jcl .... SORT TutorialThis Tutorial covers all important aspects of DFSORT. Has more SORT examples INTERVIEW QuestionsThis page covers important interview questions Mainframe Jobs Mainframe Jobs posted by members of mainframegurukul forum FaceBook PageMainframeGurukul FaceBook Page LinkedIn PageMainframeGurkul Linkedin 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-5979.html