MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
sivafdms Intermediate Joined: 29 May 2007 Posts: 165 Topics: 77
Posted: Wed Sep 19, 2007 9:50 am Post subject: copy to outfile with cond
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
CICS Guy Intermediate Joined: 30 Apr 2007 Posts: 292 Topics: 3
Posted: Wed Sep 19, 2007 9:54 am Post subject:
How about a sample if your input and output, just so we understand what you are looking for.....
Back to top
sivafdms Intermediate Joined: 29 May 2007 Posts: 165 Topics: 77
Posted: Wed Sep 19, 2007 10:07 am Post subject:
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Sep 19, 2007 10:17 am Post subject:
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
vkphani Intermediate Joined: 05 Sep 2003 Posts: 483 Topics: 48
Posted: Wed Sep 19, 2007 10:20 am Post subject:
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
sivafdms Intermediate Joined: 29 May 2007 Posts: 165 Topics: 77
Posted: Wed Sep 19, 2007 10:31 am Post subject:
Thanks kolusu..
it worked
Back to top
vkphani Intermediate Joined: 05 Sep 2003 Posts: 483 Topics: 48
Posted: Wed Sep 19, 2007 10:39 am Post subject:
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
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Back to top
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