View previous topic :: View next topic
|
Author |
Message |
rbheemana
New User
Joined: 07 Jan 2008 Posts: 8 Location: hyderabad
|
|
|
|
Hi,
Is it possible to copy certain records from a ps file to another ps file where parmeter for copy condition is in other file.
file 1:
123
file 2:
121 manohar
135 swaroop
146 lucky
098 karty
OUTPUT file (all records from 'file 2' whose key is greater than 123 ie from 'file 1'):
135 swaroop
146 lucky
Note: Problem is file1 details get updated dynamically so we can't hard code the condition. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
does always the File-1 has only one record or n-number of records? |
|
Back to top |
|
|
rbheemana
New User
Joined: 07 Jan 2008 Posts: 8 Location: hyderabad
|
|
|
|
1 rec |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rams,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1 (one record with parameter)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT Symbol as:
* TARG,+nnn
OUTREC BUILD=(C'TARG,+',1,3,80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Use TARG symbol in INCLUDE condition.
INCLUDE COND=(1,3,ZD,GT,TARG)
/*
|
|
|
Back to top |
|
|
rbheemana
New User
Joined: 07 Jan 2008 Posts: 8 Location: hyderabad
|
|
|
|
hi frank,
thanks for the help but iceman is not available in our workshop we use syncsort instead can u help me with that.... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
we use syncsort instead can u help me with that |
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
rbheemana
In Frank's solution change PGM=ICEMAN to PGM=SYNCSORT and try.
If still not resolved then post the SYNCSORT version and the SYSOUT messages showing the error! |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
rbheema,
If the JCL provided by FRANK is not working in your shop, it means the SORT product available in your shop is NOT DFSORT. You can also check this using the SYSOUT messages.
Quote: |
In Frank's solution change PGM=ICEMAN to PGM=SYNCSORT and try. |
Is the concept of SYMNAMES/SYMBOLS supported in SYNCSORT? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Quote: |
Is the concept of SYMNAMES/SYMBOLS supported in SYNCSORT?
|
Yes it is!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
In Frank's solution change PGM=ICEMAN to PGM=SYNCSORT and try. |
Krisprems,
PGM=ICEMAN and PGM=SORT will work for DFSORT and Syncsort. There's no need to tell people to change PGM=ICEMAN to PGM=SYNCSORT. In fact, it's a bad idea. If somebody does that and migrates to DFSORT, PGM=SYNCSORT will NOT work unless the System Programmers set up SYNCSORT as an alias for ICEMAN (which some do and some don't). It's best to use PGM=ICEMAN or PGM=SORT which will work with both sort products without any changes. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Frank,
I understand what you are trying to convey.
But i remember you telling once - initially DFSORT was the using ICEMAN and THERE after SYNCSORT also uses ICEMAN.
So, I though the SYNCSORT version that rbheemana was using was old and ICEMAN was not working with that.
However i would have suggeted using PGM=DFSORT |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Krisprems,
You're making this more complicated than it needs to be.
I don't think any version of Syncsort in use today could be old enough to not allow PGM=ICEMAN. If that were the case, then PGM=SORT would be the best choice. I believe PGM=SORT has been supported by both products since the beginning of time.
To reiterate:
PGM=SORT and PGM=ICEMAN are valid for invoking DFSORT or Syncsort and are recommended.
PGM=SYNCSORT and PGM=DFSORT are NOT recommended:
PGM=SYNCSORT is valid for invoking Syncsort, but is not valid for invoking DFSORT unless the site has installed SYNCSORT as an alias for ICEMAN.
PGM=DFSORT is not valid for invoking DFSORT or Syncsort unless the site has installed DFSORT as an alias for ICEMAN. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Frank Yaeger wrote: |
Krisprems,
You're making this more complicated than it needs to be.
|
|
|
Back to top |
|
|
|