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

How to mask specific fields in a record?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Thu Dec 28, 2006 2:21 pm
Reply with quote

Hi,
I hv a flat file of variable length having records > than 20000.
Let me explain the file structure:
<Fixed part>+ <n* Variable parts>
Every record has a fixed part with n number of Variable parts extended after the fixed part.
Variable part is of 29 bytes(2+27)
2 bytes for variable part type and 27 bytes for information, so totally 29 bytes.
Record Layout For example..
FIXED PART-----------| VAR PART 1 | VAR PART 2 | VAR PART 3 |:::::::::
aaaaaaaaaaaaaaaaa|04bbbbbbbbbb|02cccccccccc|01eeeeeeeeee|
Variable part type will be any one of the following : 01,02,03,04,05,06

I want to mask the variable part having type '06' with XXXX. But that variable part may come any place...


Input file:
FIXED PART-----------| VAR PART 1 | VAR PART 2 | VAR PART 3 |:::::::::
aaaaaaaaaaaaaaaaa|06bbbbbbbbbb|02cccccccccc|01eeeeeeeeee|
qqqqqqqqqqqqqqqqq|04bbbbbbbbbb|06cccccccccc|01eeeeeeeeee|
wwwwwwwwwwwww|04bbbbbbbbbb|02cccccccccc|06eeeeeeeeee|



Output file should be as follows:
FIXED PART-----------| VAR PART 1 | VAR PART 2 | VAR PART 3 |:::::::::
aaaaaaaaaaaaaaaaa|06 XXXXXXXXX|02cccccccccc|01eeeeeeeeee|
qqqqqqqqqqqqqqqqq|04bbbbbbbbbb|06XXXXXXXX|01eeeeeeeeee|
wwwwwwwwwwwww|04bbbbbbbbbb|02cccccccccc|06XXXXXXXX|
In brief, the tool should search for '06' variable part and mask the next 27 bytes( information ) with XXXX.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 3:19 pm
Reply with quote

I don't see how other than writing some quick COBOL code...But I would not be suprised if Frank might find an answer... icon_smile.gif
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: Thu Dec 28, 2006 10:49 pm
Reply with quote

kayelan,

The structure of your records is not clear from your description.

What is the RECFM and LRECL of the input file?

What is the length of the fixed part? Is it always the same length (as implied by "the fixed part") or can it be different lengths? If the same length, what is that length? If different lengths, how do you know its length for each record?

Do you always have the same number of variable parts in every record, or can you have a different number of variable parts in different records?
If the same number, how many do you have? If different numbers, then what is the maximum number of variable parts (6?).
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Thu Dec 28, 2006 11:27 pm
Reply with quote

Fixed part always of 80 bytes. No. of variable parts differ in each record but each variable part will have same length of 29 bytes (2+27): First 2 bytes tell the variable part type(01,02,03,04,05,06...any one of these) and succeeding 27 bytes contain the corresponding information. Maximum expected variable parts - 5.
In that one variable part type 06 is mandatory and also comes only once in a record but its position varies from one record to another...
i.e.,
for first record it may come as 2nd variable part,
for second record, it may come as first variable part and so on

Fixed part: 80 bytes
Var type:2
var info 27
so (81:2), (110:2),(139:2)... contain variable part type(01,02,03,04,05,06...any one of these)
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: Thu Dec 28, 2006 11:44 pm
Reply with quote

Again, what is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 12:05 am
Reply with quote

RECFM=VB,LRECL=11075
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Dec 29, 2006 12:10 am
Reply with quote

kayelan wrote:
RECFM=VB,LRECL=11075
Quote:
Fixed part always of 80 bytes. No. of variable parts differ in each record but each variable part will have same length of 29 bytes (2+27): First 2 bytes tell the variable part type(01,02,03,04,05,06...any one of these) and succeeding 27 bytes contain the corresponding information. Maximum expected variable parts - 5.
80 * (05 * 29) = 225?
What am I missing???? icon_question.gif
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: Fri Dec 29, 2006 12:19 am
Reply with quote

Quote:
What am I missing


LRECL=11075 is the maximum length for a record. Records can be shorter than that maximum.
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 12:35 am
Reply with quote

sorry, maximum 379 variable parts can occur..

So 4 + 80 + (379*299 = 11075
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: Fri Dec 29, 2006 12:47 am
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=....  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(85,2,CH,EQ,C'06'),
    OVERLAY=(87:27C'X')),
   IFTHEN=(WHEN=(114,2,CH,EQ,C'06'),
    OVERLAY=(116:27C'X')),
   IFTHEN=(WHEN=(143,2,CH,EQ,C'06'),
    OVERLAY=(145:27C'X')),
   IFTHEN=(WHEN=(172,2,CH,EQ,C'06'),
    OVERLAY=(174:27C'X')),
   IFTHEN=(WHEN=(201,2,CH,EQ,C'06'),
    OVERLAY=(203:27C'X'))
/*
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 12:54 am
Reply with quote

It seems we are having old SORT utility.. Can you check it .. I have pasted the error msg,


SYNCSORT FOR Z/OS 1.1DR TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYN
z/OS 1.6.0
SYSIN :
OPTION COPY
INREC IFTHEN=(WHEN=(85,2,PD,EQ,006),
*
OVERLAY=(87:27C'X')),
IFTHEN=(WHEN=(114,2,PD,EQ,006),
OVERLAY=(116:27C'X')),
IFTHEN=(WHEN=(143,2,PD,EQ,006),
OVERLAY=(145:27C'X')),
IFTHEN=(WHEN=(172,2,PD,EQ,006),
OVERLAY=(174:27C'X')),
IFTHEN=(WHEN=(201,2,PD,EQ,006),
OVERLAY=(203:27C'X'))
WER903I SYNCSORT 1.1 TPF3A IS NOT LICENSED FOR SERIAL 21BF9, TYPE 2064 116, L
WER903I SYNCSORT 1.1 TPF3A IS NOT LICENSED FOR SERIAL 21BF9, TYPE 2064 116, L
WER903I SYNCSORT WILL STOP WORKING IN 45 DAYS UNLESS A VALID KEY IS INSTALLE
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 12:57 am
Reply with quote

Can i do the same thing by some other commands...? Will BUILD command work for this?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Dec 29, 2006 1:36 am
Reply with quote

You Have Syncsort icon_cry.gif
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 1:37 am
Reply with quote

yeah i have
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Dec 29, 2006 1:47 am
Reply with quote

Like said before:
William Thompson wrote:
I don't see how other than writing some quick COBOL code...
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 1:59 am
Reply with quote

Can I use like this when 06 variable part type comes only in first variable part

//TOOLIN DD *
COPY FROM(SORTIN) TO(SORTOUT) USING(CT01)
//*
//CT01CNTL DD *
INREC FIELDS=(5:5,80,85:X)
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: Fri Dec 29, 2006 5:11 am
Reply with quote

kayelan,

The job I gave you works fine for 5 variable parts with DFSORT. But you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Fri Dec 29, 2006 6:43 pm
Reply with quote

thank you for your support mr Frank ! I hv written one cobol pgm instead to do the same
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Fri Dec 29, 2006 7:36 pm
Reply with quote

Hi !

As you said:

Fixed part+ n* Variable parts.
Every record has a fixed part with n number of Variable parts extended after the fixed part. Variable part is of 29 bytes(2+27)

This and your location in frankfurt, the Bankink-HQ of Germany, (same as mine) remainds me of some DTA-programms i wrote times ago. So if this problem has something to do with intertransfer between banks, plse send me a PM.

Regards, UmeySan
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top