MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

copy to outfile with cond

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Sep 19, 2007 9:50 am    Post subject: copy to outfile with cond Reply with quote

Hi,

PLease help me i tried to find in the posts bu could not found.
I want to copy from one file to other if and only if the first four characters are alphabetic.

Thanks & Regards,
Siva
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Sep 19, 2007 9:54 am    Post subject: Reply with quote

How about a sample if your input and output, just so we understand what you are looking for.....
Back to top
View user's profile Send private message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Sep 19, 2007 10:07 am    Post subject: Reply with quote

Hi CICS guy,

I/p file

1111 siva ram
siva siva siav
siva1 sss ddd
rama rama rama

now i want the output file should have only those records if the first four characters are alphabetic like

output file


siva siva siav
rama rama rama

please help

Thanks & regards,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Sep 19, 2007 10:17 am    Post subject: Reply with quote

sivafdms,

Try this job.



Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*               
//SYMNAMES DD *                       
ALPHA,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'   
//SORTIN   DD *                       
1111 SIVA RAM                         
SIVA SIVA SIAV                       
SIVA1 SSS DDD                         
RAMA RAMA RAMA                       
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                       
 SORT FIELDS=COPY                     
 INCLUDE COND=(01,01,SS,EQ,ALPHA,AND,
               02,01,SS,EQ,ALPHA,AND,
               03,01,SS,EQ,ALPHA,AND,
               04,01,SS,EQ,ALPHA)     
/*                     



Hope this helps...

Cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Sep 19, 2007 10:20 am    Post subject: Reply with quote

Siva,

You can use the below untested control card.

Code:
SORT FIELDS=COPY                                                 
OMIT COND=(1,04,SS,EQ,C'1',OR,1,04,SS,EQ,C'2',OR,1,04,SS,EQ,C'3',OR, 1,04,SS,EQ,C'4',OR,1,04,SS,EQ,C'5',OR,1,04,SS,EQ,C'6',OR,1,04,SS,EQ,C'7',OR, 1,04,SS,EQ,C'8',OR,1,04,SS,EQ,C'9',OR,1,04,SS,EQ,C'0')
Back to top
View user's profile Send private message Send e-mail
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Sep 19, 2007 10:31 am    Post subject: Reply with quote

Thanks kolusu..
it worked
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Sep 19, 2007 10:39 am    Post subject: Reply with quote

You can use the below simple DFSORT control statement.

Code:

   INCLUDE COND=(1,4,FS,NE,NUM)


FS format does a character numeric test; each byte of the specified field is checked for '0' through '9'.
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Sep 19, 2007 10:50 am    Post subject: Reply with quote

For more information on DFSORT's NUM function, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.2.5?DT=20060615173822

and

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.7.14?DT=20060615185603
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group