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
 

 

Sort first 100 records of a file in JCL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vamseepotti

New User


Joined: 21 Oct 2003
Posts: 45

PostPosted: Fri Feb 20, 2004 3:23 pm    Post subject: Sort first 100 records of a file in JCL?
Reply with quote

icon_rolleyes.gif How to copy the the first 100 records in sort file in JCL?
Back to top
View user's profile Send private message

sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Fri Feb 20, 2004 3:48 pm    Post subject:
Reply with quote

It can easily be done by IDCAMS and lot of other method.
Code:
//STEP01   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
//IN       DD   DSN=Input DSN,DISP=SHR
//OUT      DD   DSN=Output DSN,DISP=SHR
//SYSIN    DD   *
      REPRO -
         INFILE(IN) -
         OUTFILE(OUT) -
         COUNT(100)
/*

Regards,
Sandip.
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Fri Feb 20, 2004 4:28 pm    Post subject:
Reply with quote

Hello amseepotti,

You can also use the STOPAFT parameter of your SORT utility as follows:

Code:

//STEP01   EXEC PGM=SORT
//SYSOUT   DD   SYSOUT=*
//IN       DD   DSN=Input_dsn,DISP=SHR
//OUT      DD   DSN=Output_dsn,DISP=SHR
//SYSIN    DD   *
   OPTION=COPY,STOPAFT=100
/*


Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
rkurapati

New User


Joined: 12 Sep 2006
Posts: 11
Location: vizag

PostPosted: Tue Jan 02, 2007 4:09 pm    Post subject: sort initialization
Reply with quote

Hi,

I need some help as below..

Requirement:-

I need to initialize a field in a file which is at posiotion 400. The actual length of the file is 500.

Could some one help me out.

Thanks,
Ranganath
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Jan 02, 2007 4:13 pm    Post subject:
Reply with quote

Hi rkurapati,

Quote:
I need to initialize a field in a file which is at position 400. The actual length of the file is 500.


What do u mean by that do u want to move spaces for this field in all the records of the file.
Please elaborate ur question by giving in i/p & o/p

Please start a new thread for new topic
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 02, 2007 4:18 pm    Post subject:
Reply with quote

Hi Ranganath,

Look into IEBGENER.

Why don't we have a forum for utilities?
Back to top
View user's profile Send private message
rkurapati

New User


Joined: 12 Sep 2006
Posts: 11
Location: vizag

PostPosted: Tue Jan 02, 2007 4:21 pm    Post subject: sort initialization
Reply with quote

Hi Gupta,

The actual problem here is

I have a file called ---t.xxx.abc

and i have changed the length of file from 400 to 500

As i have made the length change the new file will have spaces in the 400 to 500 position.

I need to initialize to zeroes if the field is numeric and spaces to alpha numeric field.

Thanks,
Ranganath.
The field is having spaces , we need to change the field to numeric.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 02, 2007 5:33 pm    Post subject:
Reply with quote

Hi once more,

Did you take the time to have a quick look at this example of IEBGENER which definitely solves your problem?
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 02, 2007 10:18 pm    Post subject:
Reply with quote

Quote:
and i have changed the length of file from 400 to 500

As i have made the length change the new file will have spaces in the 400 to 500 position.

I need to initialize to zeroes if the field is numeric and spaces to alpha numeric field.


It's not clear what you want to do. What is the starting position and length of the field you want to check for numerics or non-numerics? Does the field have '0'-'9' for numerics or something else (e.g. PD numerics)?

Do you want to put zeroes in positions 401-500 if that field is numeric, and spaces in positions 401-500 if that field is non-numeric? What type of zeroes do you want (binary zeros, '0's, something else)?
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 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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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