|
View previous topic :: View next topic
|
| Author |
Message |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I don't see how other than writing some quick COBOL code...But I would not be suprised if Frank might find an answer...  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Again, what is the RECFM and LRECL of the input file? |
|
| Back to top |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
| RECFM=VB,LRECL=11075 |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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????  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
LRECL=11075 is the maximum length for a record. Records can be shorter than that maximum. |
|
| Back to top |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
sorry, maximum 379 variable parts can occur..
So 4 + 80 + (379*299 = 11075 |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
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 |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
| Can i do the same thing by some other commands...? Will BUILD command work for this? |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
You Have Syncsort  |
|
| Back to top |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
| yeah i have |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Like said before:
| William Thompson wrote: |
| I don't see how other than writing some quick COBOL code... |
|
|
| Back to top |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
| thank you for your support mr Frank ! I hv written one cobol pgm instead to do the same |
|
| Back to top |
|
 |
UmeySan
Active Member

Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|