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

Want to copy every alternate record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krishnakanagal

New User


Joined: 27 Feb 2009
Posts: 12
Location: Bangalore

PostPosted: Thu Jul 09, 2009 3:05 am
Reply with quote

Hi,

I have an input file having 10 records say, any LRECL, I want to copy every alternate record for e.g.

Input File
1
2
3
4
5
6
G
P
X
D

Output file
1
3
5
G
X
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 09, 2009 3:19 am
Reply with quote

You can use these DFSORT statements:

Code:

  OPTION COPY           
  OUTFIL SAMPLE=2       
Back to top
View user's profile Send private message
Rindia

New User


Joined: 17 Jun 2009
Posts: 6
Location: Hyderabad

PostPosted: Tue Jul 21, 2009 10:36 am
Reply with quote

Frank Yaeger wrote:
You can use these DFSORT statements:

Code:

  OPTION COPY           
  OUTFIL SAMPLE=2       


When i used the same syntax, it's not working for me.
Please let me know where i'm making mistake.

Error message:
ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED

ICE650I 0 VISIT www.ibm.com/storage/dfsort FOR ICETOOL PAPERS, EXAMPLES

ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN

ICE630I 0 MODE IN EFFECT: STOP
OPTION COPY
$
ICE614A 0 INVALID OPERATOR
ICE602I 0 OPERATION RETURN CODE: 12

ICE630I 2 MODE IN EFFECT: SCAN
OUTFIL SAMPLE=2
$
ICE614A 0 INVALID OPERATOR
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 12
JCl which i used :
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD DUMMY
//IN DD input file.........
//OUT DD outputfile....
//TOOLIN DD *
OPTION COPY
OUTFIL SAMPLE=2
/*
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jul 21, 2009 10:46 am
Reply with quote

Hi,

try executing PGM=SORT as below
Code:
//STEP0001 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD DSN=input file       
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                     
  OPTION COPY                       
  OUTFIL SAMPLE=2                   
/*                                 



Gerry
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: Tue Jul 21, 2009 8:35 pm
Reply with quote

Rindia,

Gerry is right. Those are DFSORT statements, not ICETOOL statements. (I assumed people knew how to code the JCL for DFSORT.)

You can either use those statements directly with DFSORT (as shown by Gerry) or you can use them indirectly with ICETOOL like this:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN   DD DSN=...  input file
//OUT  DD DSN=...  output file
//TOOLIN   DD *
COPY FROM(IN) USING(CTL1)
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,SAMPLE=2
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000080
Back to top
View user's profile Send private message
Rindia

New User


Joined: 17 Jun 2009
Posts: 6
Location: Hyderabad

PostPosted: Wed Jul 22, 2009 10:33 am
Reply with quote

Thank You Gerry and Frank.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top