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
 

 

Extract only first record from PS to another one using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Extract only first record from PS to another one using SORT
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: 6967
Location: porcelain throne

PostPosted: Thu Apr 16, 2009 5:15 pm    Post subject:
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):

http://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

Senior Member


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

PostPosted: Thu Apr 16, 2009 7:09 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Apr 16, 2009 7:21 pm    Post subject:
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Thu Apr 16, 2009 7:46 pm    Post subject:
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Apr 17, 2009 5:11 pm    Post subject:
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    Post subject:
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    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
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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