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: 28 Mar 2008
Posts: 1
Location: Chennai

 0 salutes

Posted: Mon Mar 31, 2008 11:12 am    Post subject: Sorting - SORT INREC OUTREC SUM FIELDS

Hi,

Can you help me in understanding what the following sort card does ?

 Code: //SYSIN DD *                                         SORT FIELDS=(1,3,CH,A)                           INREC FIELDS=(1,3,2Z,4,3)                         SUM FIELDS=(4,5,ZD)                               OUTREC FIELDS=(1:1,3,4:4,5,ZD,EDIT=(II,IIT))  /*
 <-- Click on right mark icon. If this post answer your question.

Moderator

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

 1 salutes

Posted: Tue Apr 01, 2008 12:35 am    Post subject:

It avoids a SUM overflow by reformatting the 3-byte ZD field in positions 4-6 into a 5-byte ZD field in positions 4-8. The INREC statement adds 2 binary zeros before the 3-byte ZD field to make it a 5-byte ZD field. It probably should be adding two character zeros (C'00' = X'F0F0') since it's a ZD field, but X'0000' will work since the zone is ignored. (Perhaps whoever created the job thought 2Z meant 2 ZD zeros instead of 2 binary zeros.)

More specifically:

INREC - Creates a record with the following fields:

1-3 - input positions 1-3
4-5 - binary zeros (X'0000')
6-8 - input positions 4-6

SORT - sorts on positions 1-3

SUM - for records which have the same value in positions 1-3, keeps one of the records and sums the values in positions 4-8 (e.g. X'0000F1F2F3).

OUTREC - Creates an output record with the following fields:

1-3 - input positions 1-3
4-9 - the ZD total in positions 4-8 edited to a displayable value of dd,ddd with leading zeros suppressed, e.g.

 Code: 12,345  3,456    789

_________________
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.

Member

Joined: 23 May 2008
Posts: 2

 0 salutes

 Posted: Tue May 27, 2008 9:33 am    Post subject: hi , i need to sort an input file. the sorted file should not contain the first two fields of the input file.
 <-- 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 May 27, 2008 8:06 pm    Post subject: Remya, Please start a new topic for this new question and provide more information. Show an example of the records in the input file (relevant fields only) and what you expect for the output records. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field._________________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 Search Batch file-aid help 14 frenchman 31122 Mon Feb 01, 2016 10:23 pmacademyindia4 File-Aid Help 3 Nicholas 21039 Mon Feb 01, 2016 10:22 pmacademyindia4 Hi plz help me out 7 Guest 20834 Mon Feb 01, 2016 10:14 pmacademyindia4 Need urgent HELP 4 Sulagna 12205 Mon Feb 01, 2016 1:39 amacademyindia4 executing java program thru JCL 6 Guest 24197 Tue Feb 12, 2013 1:56 pmAnuj 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-3272.html