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
 

 

Want to copy every alternate record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Want to copy every alternate record
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 Moderator


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

PostPosted: Thu Jul 09, 2009 3:19 am    Post subject:
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    Post subject:
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 http://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: 1703
Location: Australia

PostPosted: Tue Jul 21, 2009 10:46 am    Post subject:
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 Moderator


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

PostPosted: Tue Jul 21, 2009 8:35 pm    Post subject:
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:

http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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