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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Jul 31, 2008 4:55 pm
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
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
Reply with quote

@Karthik

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

Moderator Emeritus


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

PostPosted: Thu Jul 31, 2008 9:02 pm
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 Developer


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

PostPosted: Thu Jul 31, 2008 9:37 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top