File aid help!

In this Mainframe Forum - You can post your queries on FILE-AID tool

Moderators: Anuj Dhawan, Moderator Group

chandiok
Member
Posts: 6
Joined: Thu Apr 30, 2009 3:14 am

File aid help!

Post by chandiok » Thu Apr 30, 2009 3:22 am

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

maheshvamsi
Active Member
Posts: 52
Joined: Wed Mar 25, 2009 11:56 pm
Location: Banglore

Post by maheshvamsi » Thu Apr 30, 2009 10:31 am

Not Sure About File-Aid, but we can extract records which do not contain a particular character in any postion through SORT.

Please let us know, if you want a solution for this in sort.
Thanks

MaheshVamsi

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Apr 30, 2009 10:40 am

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.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

chandiok
Member
Posts: 6
Joined: Thu Apr 30, 2009 3:14 am

Post by chandiok » Thu Apr 30, 2009 8:58 pm

maheshvamsi wrote:Not Sure About File-Aid, but we can extract records which do not contain a particular character in any postion through SORT.

Please let us know, if you want a solution for this in sort.
Cool!, would love to know it appreciate your help. Thanks

chandiok
Member
Posts: 6
Joined: Thu Apr 30, 2009 3:14 am

Post by chandiok » Thu Apr 30, 2009 9:03 pm

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.
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.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Fri May 01, 2009 6:53 pm

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.
Regards,
Anuj

chandiok
Member
Posts: 6
Joined: Thu Apr 30, 2009 3:14 am

Post by chandiok » Sat May 02, 2009 3:33 am

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.
Anuj,
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

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sun May 03, 2009 9:59 pm

Can "AAA" appear anywhere in the record to be selected?
Regards,
Anuj

chandiok
Member
Posts: 6
Joined: Thu Apr 30, 2009 3:14 am

Post by chandiok » Mon May 04, 2009 1:33 am

Anuj D. wrote:Can "AAA" appear anywhere in the record to be selected?
That is the problem AAA and ART both can appear anywhere in the record.
Thanks

maheshvamsi
Active Member
Posts: 52
Joined: Wed Mar 25, 2009 11:56 pm
Location: Banglore

Post by maheshvamsi » Mon May 04, 2009 11:25 am

I saw this post now only. you can use below code. Assumed input & oupt file are of record length 80.

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
Output:

Code: Select all

123456 AAA 132456 AVT

Please let us know, if you are still facing any issue.
Thanks

MaheshVamsi

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon May 04, 2009 12:44 pm

Hi,
We need to extrract record that contain AAA but not ART in a record.
Probably in below sort control statements, we need "AND" instead of "OR"

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
with the input and control card you show; win your exapple output would be:

Code: Select all

123456 AAA 132456 ART 
123456 AAA 132456 AVT 
unless you replace "OR" with "AND".
Regards,
Anuj

maheshvamsi
Active Member
Posts: 52
Joined: Wed Mar 25, 2009 11:56 pm
Location: Banglore

Post by maheshvamsi » Mon May 04, 2009 3:18 pm

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.

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

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon May 04, 2009 4:20 pm

Please spell my name correctly, that's Anuj.

Have a good one,

Ad

maheshvamsi
Active Member
Posts: 52
Joined: Wed Mar 25, 2009 11:56 pm
Location: Banglore

Post by maheshvamsi » Mon May 04, 2009 9:15 pm

Typo, I update the post.

have a niceday.
Thanks

MaheshVamsi

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue May 05, 2009 12:04 pm

Thank You . . . :)
Regards,
Anuj

Post Reply

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



Other References
Mainframe Tools and others