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

copy file records basing on condition


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

New User


Joined: 07 Jan 2008
Posts: 8
Location: hyderabad

PostPosted: Mon Jan 07, 2008 10:05 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jan 07, 2008 10:09 pm
Reply with quote

does always the File-1 has only one record or n-number of records?
Back to top
View user's profile Send private message
rbheemana

New User


Joined: 07 Jan 2008
Posts: 8
Location: hyderabad

PostPosted: Mon Jan 07, 2008 10:17 pm
Reply with quote

1 rec
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: Mon Jan 07, 2008 10:35 pm
Reply with quote

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
View user's profile Send private message
rbheemana

New User


Joined: 07 Jan 2008
Posts: 8
Location: hyderabad

PostPosted: Mon Jan 07, 2008 10:53 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 07, 2008 11:23 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 08, 2008 9:53 am
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jan 08, 2008 10:21 am
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 08, 2008 11:46 am
Reply with quote

Quote:
Is the concept of SYMNAMES/SYMBOLS supported in SYNCSORT?
Yes it is!!
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: Tue Jan 08, 2008 10:40 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jan 09, 2008 2:21 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 09, 2008 10:49 pm
Reply with quote

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. icon_lol.gif

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jan 10, 2008 12:15 pm
Reply with quote

Frank Yaeger wrote:
Krisprems,

You're making this more complicated than it needs to be.

icon_rolleyes.gif
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 Unable to interpret a hex value to De... COBOL Programming 4
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts how to eliminate null indicator value... DB2 7
Search our Forums:

Back to Top