Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Masking in INREC FIELDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Ace

New User


Joined: 03 May 2007
Posts: 14
Location: Delhi

PostPosted: Tue Nov 06, 2007 7:22 am    Post subject: Masking in INREC FIELDS
Reply with quote

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
Back to top
View user's profile Send private message

Aaru

Senior Member


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

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

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.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Nov 06, 2007 9:16 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Ace

New User


Joined: 03 May 2007
Posts: 14
Location: Delhi

PostPosted: Wed Nov 07, 2007 9:07 am    Post subject: Reply to: Masking in INREC FIELDS
Reply with quote

Thanks Frank...

I got the better clarity here but did not understand the meaning of M0.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Nov 07, 2007 9:47 am    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Ace

New User


Joined: 03 May 2007
Posts: 14
Location: Delhi

PostPosted: Thu Nov 08, 2007 5:16 am    Post subject: Reply to: Masking in INREC FIELDS
Reply with quote

Thanks krisprems...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us