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
 

 

I want the first two records in one o/p file and the 3rd rec

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

New User


Joined: 11 Jul 2008
Posts: 10
Location: Chennai

PostPosted: Thu Jul 31, 2008 4:14 pm    Post subject: I want the first two records in one o/p file and the 3rd rec
Reply with quote

hi
I have the following in the input file
12345
13245
23456

I want the first two records in one o/p file and the 3rd record in another o/p file

give sum ideas...[/
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jul 31, 2008 4:55 pm    Post subject:
Reply with quote

What have you tried for yourself so far, what were the results and/or error messages ?
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu Jul 31, 2008 5:09 pm    Post subject: Reply to: I want the first two records in one o/p file and t
Reply with quote

Hi,

Anyone please tell me what's wrong with the following sort card

Code:

//JSTP0010 EXEC PGM=SYNCSORT                   
//SORTIN   DD  DSN=DEV2.RK.TEST(@@CASE1),       
//             DISP=SHR                         
//SORTOF01 DD  DSN=DEV2.RK.TEST(@@CASE2),       
//             DISP=SHR                         
//SORTOF02 DD  DSN=DEV2.RK.TEST(@@CASE3),       
//             DISP=SHR                         
//SYSOUT   DD SYSOUT=*                         
//SYSUDUMP DD SYSOUT=*                         
//SYSIN    DD *                                 
 SORT FIELDS=COPY                               
 OUTFIL FILES=01,STOPAFT=2                     
 OUTFIL FILES=02,STARTREC=3                     
                                               
/*                                             
//*                                             


I am getting the following error,

Code:

SYSIN :                                         
 SORT FIELDS=COPY                               
 OUTFIL FILES=01,STOPAFT=2                       
                 *                               
 OUTFIL FILES=02,STARTREC=3                     
                                                 
WER161B  ALTERNATE PARM USED                     
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   



Regards
R KARTHIK
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Thu Jul 31, 2008 6:21 pm    Post subject:
Reply with quote

@Karthik

Try ENDREC inplace of STOPAFT
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 31, 2008 9:02 pm    Post subject:
Reply with quote

Hello srramesh,

Your "screenshot" has been deleted. You have been asked before to not attach images/screenshots/etc.

Again. . . To show what you see on your terminal, use copy/paste and the "Code" tag. There is a Preview function so you can see how your post will appear to the forum. Use t and when you are satisfied with how your post appears, click Submit.

Any new screenshots posted will be deleted with no followup. . .
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: Thu Jul 31, 2008 9:37 pm    Post subject:
Reply with quote

srramesh,

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
12345
13245
23456
/*
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,ENDREC=2
  OUTFIL FNAMES=OUT2,SAVE
/*


Alternatively, if you have z/OS DFSORT V1R5 PTF UK90013 (July, 2008) installed, you can use this DFSORT/ICETOOL job:

Code:

//S2   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
12345
13245
23456
/*
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT1) INPUT KEEP FIRST(2) DISCARD(OUT2)
/*
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 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
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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