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 

File-Aid/Syncsort trick required please !

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


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Wed Sep 26, 2007 9:29 am    Post subject: File-Aid/Syncsort trick required please ! Reply with quote

Hi,

I have an input file of 91 bytes.

I want to extract the records based on following criteria:

1). Column 14 to 16 should contain value "ABC".
2). Column 23 to 31 should be spaces
3). Column 65 to 71 should be greater than zero
4). Column 32 to 37 should have any of these values (ARMADA, XANDAR, PUGEOT, BEOHVA, VAJRAN, URAM).

Length of output file is also 91 bytes.

Would you please give me File-Aid/Syncsort code for this Question

Thanks in Advance. Smile
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

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

Have you tried seaching for the answer, it seems to me that a lots of examples doing the same sort of thing, you may have to adjust position number etc but a little thinking never harmed anyone.
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Wed Sep 26, 2007 12:24 pm    Post subject: Reply with quote

Try this JCL:
Code:

//STEP1  EXEC PGM=SORT
//SORTIN DD DSN=input.file                 
//SORTOUT DD DSN=output.file
//SYSOUT DD SYSOUT=*                                               
//SYSIN DD *                                                       
   SORT FIELDS=COPY                                               
   INCLUDE COND=(14,3,CH,EQ,C'ABC',AND,23,9,CH,EQ,C'         ',AND,
   65,7,CH,GT,C'0000000',AND,                                     
   (32,6,CH,EQ,C'ARMADA',OR,32,6,CH,EQ,C'XANDAR',                 
   OR,32,6,CH,EQ,C'PUGEOT',OR,32,6,CH,EQ,C'BEOHVA',OR,             
   32,6,CH,EQ,C'VAJRAN',OR,32,6,CH,EQ,C'URAM  '))                 
/*

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
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 26, 2007 12:54 pm    Post subject: Reply with quote

Alissa,

FYI, you don't need to code all those blanks for a condition like

Code:

23,9,CH,EQ,C'         '


One blank will do

Code:

23,9,CH,EQ,C' '


DFSORT pads the character string with blanks on the right to the length of the field. I'd be very surprised if Syncsort doesn't.
_________________
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
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Wed Sep 26, 2007 1:16 pm    Post subject: Reply with quote

Frank,

You are correct, SyncSort does the same, so the extra blanks are not necessary. It's just my coding style/preference. I like to code the "place holders".
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
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 26, 2007 2:32 pm    Post subject: Reply with quote

Quote:
I like to code the "place holders".


That must be fun when the field is 100 characters. Laughing
_________________
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
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Thu Sep 27, 2007 1:33 pm    Post subject: Reply with quote

Thanks to amargulies.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
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