File aid help!
Moderators: Anuj Dhawan, Moderator Group
File aid help!
Is there some way we can "NC" not contain in file aid batch JCL under list command to select records that do not contain a particular charcter in any position of a record.
Thanks
Thanks
-
- Active Member
- Posts: 52
- Joined: Wed Mar 25, 2009 11:56 pm
- Location: Banglore
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Great! thanks for the info, I will keep that in mind. The problem I had needed an AND condition with Co (contain) and NC (not contain), this is a good idea too so I keep that in mind for future use. Appreciate your help.dbzTHEdinosauer wrote:you could always delete the records in your file that have the character, and then save what is left as a new file, which would contain only records that do not contain the char.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Anuj,Anuj D. wrote:Hi,
Suggest you show some sample input and expected output from that? Tell us the rules to derive that "output"; and also tell us the LRECL & RECFM of input/output.
The input file is FB and Lrecl 80 the output is same as input
We need to extrract record that contain AAA but not ART in a record.
any suggestions are welcome
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Active Member
- Posts: 52
- Joined: Wed Mar 25, 2009 11:56 pm
- Location: Banglore
I saw this post now only. you can use below code. Assumed input & oupt file are of record length 80.
Input:
Output:
Please let us know, if you are still facing any issue.
Code: Select all
//SORT EXEC PGM=SORT
//SORTIN DD disp=shr, dsn=Input file of record lenght 80
//SORTOUT DD disp=shr,dsn=Output file of record length 80
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,80,SS,EQ,C'AAA',OR,
1,80,SS,NE,C'ART')
/*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
Input:
Code: Select all
123456 AAA 132456 ART
123456 AAA 132456 AVT
123456 BAA 132456 ART
Code: Select all
123456 AAA 132456 AVT
Please let us know, if you are still facing any issue.
Thanks
MaheshVamsi
MaheshVamsi
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Hi,
And maheshvamsi, I'm not sure why would you say the output is: with the input and control card you show; win your exapple output would be: unless you replace "OR" with "AND".
Probably in below sort control statements, we need "AND" instead of "OR"We need to extrract record that contain AAA but not ART in a record.
Code: Select all
INCLUDE COND=(1,80,SS,EQ,C'AAA',OR,
1,80,SS,NE,C'ART')
And maheshvamsi, I'm not sure why would you say the output is:
Code: Select all
123456 AAA 132456 AVT
Code: Select all
123456 AAA 132456 ART
123456 AAA 132456 AVT
Regards,
Anuj
Anuj
-
- Active Member
- Posts: 52
- Joined: Wed Mar 25, 2009 11:56 pm
- Location: Banglore
Yes, Anuj you are absolutely correct, I thought I edited this post with AND.
In sort cord we need to Use AND, Instead of OR. I checked it in my system, I updated the output, forgot to update control card.
anyway thank you. for updating me.
This is the correct control card.
In sort cord we need to Use AND, Instead of OR. I checked it in my system, I updated the output, forgot to update control card.
anyway thank you. for updating me.
This is the correct control card.
Code: Select all
SORT FIELDS=COPY
INCLUDE COND=(1,80,SS,EQ,C'AAA',AND,
1,80,SS,NE,C'ART')
Last edited by maheshvamsi on Mon May 04, 2009 9:15 pm, edited 2 times in total.
Thanks
MaheshVamsi
MaheshVamsi
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Active Member
- Posts: 52
- Joined: Wed Mar 25, 2009 11:56 pm
- Location: Banglore
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page