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

jcl sort to add leading zeroes

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
sasanka
Member


Joined: 29 Dec 2010
Posts: 19
Location: hyderabad

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

PostPosted: Sun Jan 16, 2011 12:29 am    Post subject: jcl sort to add leading zeroes Reply with quote

Dear all,

i have the following input ps

76453627
0097865432
00065499234
00012342345
12301231233
.......
....
i want a jcl which adds leading zeroes to all the numbers in the ps where the number of digits are not equal to 11

i.e for the first number 76453627(8 digits) to be as 00076453627(11 digits)

if the numbers is of 11 digits 00065499234(11 digts)
it should not add leading zeroes

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

Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

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

PostPosted: Mon Jan 17, 2011 6:22 pm    Post subject: Reply with quote

For the given example, try this:
Code:
//STEP001  EXEC PGM=SORT               
//SORTIN DD *                         
76453627                               
0097865432                             
00065499234                           
00012342345                           
12301231233                           
//SORTOUT DD SYSOUT=*                 
//SYSIN DD *                           
  OPTION COPY                         
  INREC BUILD=(1,11,UFF,M11,LENGTH=11)
//SYSOUT DD SYSOUT=*                   
//*

_________________
Regards,
Anuj
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.
sasanka
Member


Joined: 29 Dec 2010
Posts: 19
Location: hyderabad

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

PostPosted: Mon Jan 17, 2011 9:08 pm    Post subject: Reply with quote

Anuj Dhawan wrote:
For the given example, try this:
Code:
//STEP001  EXEC PGM=SORT               
//SORTIN DD *                         
76453627                               
0097865432                             
00065499234                           
00012342345                           
12301231233                           
//SORTOUT DD SYSOUT=*                 
//SYSIN DD *                           
  OPTION COPY                         
  INREC BUILD=(1,11,UFF,M11,LENGTH=11)
//SYSOUT DD SYSOUT=*                   
//*



can u please explain the following
uff
m11 Question
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

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

PostPosted: Tue Jan 18, 2011 4:22 pm    Post subject: Reply with quote

UFF stands for unsigned free form and M11 would tell SORT to use leading zeros, e.g. 27 would be displayed as '0000000027'. DFSORT has 27 edit masks as well as an EDIT parameter that lets you design your own masks.
_________________
Regards,
Anuj
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.
Frank Yaeger
Moderator


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

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

PostPosted: Tue Jan 18, 2011 11:30 pm    Post subject: Reply with quote

sasanka,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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: Tue Jan 19, 2016 12:57 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.
academyindia4
Guest





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

PostPosted: Mon Feb 01, 2016 10:04 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 -> JCL 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 SORT JCL - SORTING A VB FILE - INREC OUTREC PARSE BUILD 7 ambilileela 22225 Wed Feb 03, 2016 1:07 am
academyindia4 View latest post
No new posts Omitt records from sort but still include them in output 2 korey 10995 Mon Jan 25, 2016 11:10 pm
academyindia4 View latest post
No new posts Sumup of the fields in sort 6 Cruise 23492 Mon Jan 25, 2016 11:10 pm
academyindia4 View latest post
No new posts How to Sort the JObs in SAR. 0 Deep Singh 5885 Thu Feb 08, 2007 6:18 pm
Deep Singh View latest post
No new posts Help required for a sort step. 5 ambilileela 6779 Tue Jul 04, 2006 9:00 pm
Frank Yaeger 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-5603.html