View previous topic :: View next topic
|
Author |
Message |
udaydara
New User
Joined: 08 Mar 2009 Posts: 10 Location: Hyderabad
|
|
|
|
Hi all,
Today I am having an request for coping only few selected records from a file to another file .
Input file will have the search key at different positions.
EXAMPLE:
Input file:(this is Variable block file)
1234 NAME1 EMPLOYEE 1234567
2345 NAME2 EMPLOYEE ADDRESS 1234567
3345 NAME3 1234567
4345 NAME5 EMPLOYEE ADDRESS 3456789
3345 NAME6 9234567
8734 NAME7 EMPLOYEE 1274567
3345 NAME2 37918372
3445 NAME5 EMPLOYEE ADDRESS 4567890
55345 NAME7 1234572
1211 NAME8 EMPLOYEE 1234567
2225 NAME9 EMPLOYEE ADDRESS 0123456
3345 NAME10 5671234
1444 NAME11 EMPLOYEE 1234567
3675 NAME22 1238867
1674 NAME41 EMPLOYEE 1234567
3235 NAME52 1239967
2675 NAME22 EMPLOYEE ADDRESS 1223457
If will give the search key as 1234567
expecting output file as
1234 NAME1 EMPLOYEE 1234567
2345 NAME2 EMPLOYEE ADDRESS 1234567
3345 NAME3 1234567
1444 NAME11 EMPLOYEE 1234567
1674 NAME41 EMPLOYEE 1234567
because only those five records are having search key '1234567'.
Can do this with the help of a DFSORT?Is there any other way of doing this task simple.
I tried using 3.14 utility but that is not resolving my problem. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Take a read of the DFSORT documentation and look for the SS (Substring search ?) section. It's good, it's very very good.
I am sure that you will also find numerous examples on the forum too. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Uday,
You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=VB and LRECL=80, but the job can be changed appropriately for other LRECLs by replacing 76 with LRECL-4.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/80)
//SORTOUT DD DSN=... output file (VB/80)
//SYSIN DD *
OPTION COPY,VLSCMP
INCLUDE COND=(5,76,SS,EQ,C'1234567')
/*
|
|
|
Back to top |
|
|
udaydara
New User
Joined: 08 Mar 2009 Posts: 10 Location: Hyderabad
|
|
|
|
Hi Frank,
Thanks for replying to my query,
I tried your solution but getting the below syntax error.
My input file LRECL is 20112.
Current version of DFSORT Installed is VER14
Spool error:
Code: |
SYSIN :
OPTION COPY,VLSCMP
*
INCLUDE COND=(5,20108,SS,EQ,C'1234567890')
WER268A OPTION STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
Please advice me what to do next |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
Current version of DFSORT Installed is VER14 |
WER* message codes indicates that you are using SYNCSORT not DFSORT |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Uday,
The job works fine 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 |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Uday,
Try this SyncSort for z/OS application:
Code: |
//STEP1 EXEC PGM=SORT,PARM='VLTESTI=2'
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your.vb.input,...
//SORTOUT DD DSN=your.vb.output,...
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,76,SS,EQ,C'1234567')
/* |
|
|
Back to top |
|
|
udaydara
New User
Joined: 08 Mar 2009 Posts: 10 Location: Hyderabad
|
|
|
|
Thanks Frank and Margulies for your time.
I have tried the above code,its working for me.
|
|
Back to top |
|
|
|