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

Extract only first record from PS to another one using SORT


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

New User


Joined: 17 Mar 2009
Posts: 30
Location: Bangalore.India

PostPosted: Thu Apr 16, 2009 5:04 pm
Reply with quote

I want to extract only first record from PS to another one using SORT.
No any key or Index assigned to records. I have sorted the file in descending order and now I want to pick the first one record.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 16, 2009 5:15 pm
Reply with quote

not being a sort expert, but have bothered to follow many thread on the subject;

sounds as if this could be done in one pass:
  1. sort
  2. output restricted to 1 record, STOPAFT (however it is spelled) is the control parm that you want.


if you would look in the DFSORT/ICETOOL forum, where this thread should have been,
FRANK has created a Sticky which provides links to reference material (documentation):

ibmmainframes.com/viewtopic.php?t=1348&sid=7d1a98a84684eff3d964c6aa798ab0ba

but then again, you could wait a while and someone will give you the answer,
thus sparing you the pain and discomfort of looking it up yourself.

or asking one of your peers at IBM India

no wonder so many people don't look at the documentation,
even the experts do not!

does your boss know that you advertise your lack of expertise on these forums?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Apr 16, 2009 7:09 pm
Reply with quote

Hi,

If you are DFSORT user and have z/OS DFSORT PTF UK90013 (July, 2008) installed, try this:
Code:
//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT KEEP FIRST
/*
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Apr 16, 2009 7:21 pm
Reply with quote

Or you may try this as well:
Code:
//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    HEADER1=(1,80),
/*
I assume input is of type FB/80.
Back to top
View user's profile Send private message
swapnilushinde

New User


Joined: 17 Mar 2009
Posts: 30
Location: Bangalore.India

PostPosted: Thu Apr 16, 2009 7:36 pm
Reply with quote

dbzTHEdinosauer,
I have solved the same problem using IDCAMS. but i want to shorten the whole code. I wanted to use sort because by this I can club all SORT commands in SYNCTOOL and reduce the lenght of code.
I have tried this with ICETOOL long ago. but to extract the first record is not supporting here.
That's why I asked this thing on FORUM.... There is no any need to inform my Boss.....
Thanks a lot....... icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 16, 2009 7:46 pm
Reply with quote

I am sure that you can use SYNCSORT and generate two output files in one pass
  1. the complete file in descending order
  2. a copy of the first record of the first file


I was referring to your displaying the fact that you work for IBM India. IBM India also makes money for consultant work. But who would want to pay for someone of your experience and initiative level?
Back to top
View user's profile Send private message
swapnilushinde

New User


Joined: 17 Mar 2009
Posts: 30
Location: Bangalore.India

PostPosted: Fri Apr 17, 2009 4:53 pm
Reply with quote

dbzTHEdinosauer ,
Just to let you know I am a direct graduate hier and working with IBM INDIA for last 6 months. I am unaware of fact that this forum is for the people who are 'EXPERT' according to your criteria....
'EXPERTISE IS NOT ACHIEVED WITHIN A NIGHT..' Isn't it???
Anyways Thanks for your advice.....
icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 17, 2009 5:11 pm
Reply with quote

you are missing my point.

this forum is to help others, and giving those with experience a chance to share.

what I was 'sharing' with you is that from a business point of view,
I would not want my customers knowing that they pay good money for
inexperienced help.

I imagine that you are proud to have a job, and have a job with IBM.

I would remove the IBM India from your signature
- this forum is not a place to advertise your association.
That is what I meant
by 'your boss knowing'.

My words have nothing to do with technical expertise.
It has to do with conducting a business.
Back to top
View user's profile Send private message
swapnilushinde

New User


Joined: 17 Mar 2009
Posts: 30
Location: Bangalore.India

PostPosted: Fri Apr 17, 2009 6:05 pm
Reply with quote

ok...ok... I got it... I have removed it from my signature..
Thanks for your suggestion...
Sorry for miss understanding... icon_sad.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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top