IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Masking in INREC FIELDS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1287
Location: Chennai, India

PostPosted: Tue Nov 06, 2007 11:02 am
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 Developer


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

PostPosted: Tue Nov 06, 2007 9:16 pm
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:

Use [URL] BBCode for External Links
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts INREC PARSE used to sort a CSV file DFSORT/ICETOOL 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
Search our Forums:

Back to Top