View previous topic :: View next topic
|
Author |
Message |
karthikbabudh
New User
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
|
|
|
|
Hi All,
Can anyone help me to how to copy data from vsam to sequential file after masking some data depending upon certain contains.
babu. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
after masking some data depending upon certain contains. |
You need to give the details of what exactly you're trying to do. |
|
Back to top |
|
|
karthikbabudh
New User
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
|
|
|
|
Hi,
I need to write a cobol pgm to read a vsam file and write data to a PS after masking some data depending upon certain contains.
eg :
INPUT FILE:
empidempnameaddress
00000nnnnnnnnaaaaaaa
if the empid is greater than 77777 then empname should be masked to 'zzzzzzzz'
OUTPUT FILE
empidempnameaddress
77777zzzzzzzzaaaaaaa
Regards,
Karthik. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Well, I can't help you with a COBOL program (you might have better luck with that in a COBOL Forum). but if doing this with DFSORT is an option for you, I can show you how to do that. |
|
Back to top |
|
|
karthikbabudh
New User
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
|
|
|
|
Hi Frank,
Can u send me the DFSORT commands.may be usefull for me.
Regards,
Karthik. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job to do what you asked for, assuming you want to treat the VSAM file as variable length:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... VSAM input file
//SORTOUT DD DSN=... output file (VB)
//SYSIN DD *
OPTION COPY
RECORD TYPE=V
INREC IFTHEN=(WHEN=(5,5,ZD,GT,+77777),
OVERLAY=(10:C'zzzzzzzz'))
/*
|
If you can treat the VSAM file as fixed length, you can use this version of the job:
Code: |
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... VSAM input file
//SORTOUT DD DSN=... output file (FB)
//SYSIN DD *
OPTION COPY
RECORD TYPE=F
INREC IFTHEN=(WHEN=(1,5,ZD,GT,+77777),
OVERLAY=(6:C'zzzzzzzz'))
/*
|
|
|
Back to top |
|
|
vishal_a
New User
Joined: 24 May 2005 Posts: 45 Location: Noida
|
|
|
|
Thanks frank
Well it solved my problem also...
great
vishal |
|
Back to top |
|
|
karthikbabudh
New User
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
|
|
|
|
Thanks a lot frank
Regards,
Karthik. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Glad I could help. |
|
Back to top |
|
|
|