Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Ace

New User

Joined: 03 May 2007
Posts: 14
Location: Delhi

Posted: Tue Nov 06, 2007 7:22 am    Post subject: Masking in INREC FIELDS

What is the meaning of these statements:

 Code: //SYSIN DD *   INREC FIELDS=(1,40,X'0000001C')   SORT FIELDS=(5,3,PD,A)   SUM FIELDS=(41,4,PD)   OUTREC FIELDS=(1:5,3,PD,M0,      12:41,4,PD,M0) /*

What this X'0000001C' signifies. My input file size is 40 bytes

Aaru

Senior Member

Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

Posted: Tue Nov 06, 2007 11:02 am    Post subject: Reply to: Masking in INREC FIELDS

Ace,

 Quote: What this X'0000001C' signifies.

 Quote: INREC FIELDS=(1,40,X'0000001C')

Before sorting, you are adding an hexadecimal string "0000001C" after writing the first 40 bytes of input data.

refer to the manuals in the forum for the detailed explanations.
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Tue Nov 06, 2007 9:16 pm    Post subject:

 Code: INREC FIELDS=(1,40,X'0000001C')   SORT FIELDS=(5,3,PD,A)   SUM FIELDS=(41,4,PD)   OUTREC FIELDS=(1:5,3,PD,M0,      12:41,4,PD,M0)

INREC statement - copies input positions 1-40 and adds a PD value of 1 in positions 41-44. The PD value of 1 is being used as a counter.

SORT - sorts on the key which is the PD value in positions 5-8.

SUM - for each key value, keeps one record and adds up the counter to get the count of records for that key. So you end up with one record per key containing the count of records with that key.

OUTREC - converts the key value to a printable value in the form IIIITS with leading zeros suppressed and a trailing sign of blank or - (for example, '1234 ' or ' 1-'. Converts the counter to a printable value in the same form.

For example, if the input records had:

 Code: Key (PD) -1234 -1234 +1234 -1234 +1234

The output would be

 Code: Key       Count 1234-         3 1234          2

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Ace

New User

Joined: 03 May 2007
Posts: 14
Location: Delhi

 Posted: Wed Nov 07, 2007 9:07 am    Post subject: Reply to: Masking in INREC FIELDS Thanks Frank... I got the better clarity here but did not understand the meaning of M0.
krisprems

Active Member

Joined: 27 Nov 2006
Posts: 649
Location: India

 Posted: Wed Nov 07, 2007 9:47 am    Post subject: Ace M0 is an EDIT mask, for a list of the DFSORT edit masks, look here http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cg20/2.4.8?ACTION=MATCHES&REQUEST=edit+mask&TYPE=FUZZY&SHELF=ICE1SH20.bks&DT=20060615173822&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Ace

New User

Joined: 03 May 2007
Posts: 14
Location: Delhi

 Posted: Thu Nov 08, 2007 5:16 am    Post subject: Reply to: Masking in INREC FIELDS Thanks krisprems...
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us