Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

copy file records basing on condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: copy file records basing on condition
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    Post subject:
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    Post subject: Reply to: copy file records basing on condition
Reply with quote

1 rec
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Jan 07, 2008 10:35 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Jan 07, 2008 11:23 pm    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Jan 08, 2008 10:21 am    Post subject: Reply to: copy file records basing on condition
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    Post subject:
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 Moderator


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

PostPosted: Tue Jan 08, 2008 10:40 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 09, 2008 10:49 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us