Search a filename in another file Using DFSORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Search a filename in another file Using DFSORT

Postby pinakimishra » Fri Mar 29, 2019 8:33 pm

Hi,

I have a requirement where I need to pass a name of 50 characters from multiple jobs and I need to search that name in a File A at specific position i.e from 1 to 50. The File A will have 100 filenames. I am going to create 100 jobs which will pass the filename as a parameter and that will be searched in file A. If founf return code will be 0 else return code will be 4. How can I do it through DFSORT?

I can do it through Cobol where I can pass the filename as a PARM parametr through linkage section and search in the File A which will be passed as an i/p file.

Can it be done through Sort?

Thanks
Pinaki
pinakimishra
 
Posts: 7
Joined: Thu Mar 07, 2019 6:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Search a filename in another file Using DFSORT

 

Re: Search a filename in another file Using DFSORT

Postby enrico-sorichetti » Fri Mar 29, 2019 8:44 pm

unfortunately the description of the requirement is clear as mud
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2846
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 151 times

Re: Search a filename in another file Using DFSORT

Postby NicC » Sat Mar 30, 2019 3:44 am

Sample input and expected output please - in the code tags.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2867
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 126 times

Re: Search a filename in another file Using DFSORT

Postby pinakimishra » Mon Apr 01, 2019 8:24 pm

Below is the Scenario:

I have a File SMD.Static.DATAFILE which has the below data inside it.
Filename , Indicator
ABC.XYZ.TESTJOAB.DATAFILE, Y
DEF.UVW.TESTJOCD.DATAFILE, N
GHI.REW.TESTJOEF.DATAFILE, Y
IJK.BMC.TESTJOGH.DATAFILE, N
LMN.EQY.TESTJOIJ.DATAFILE, N
OPQ.MFD.TESTJOKL.DATAFILE, Y
RST.SBS.TESTJOMN.DATAFILE, Y


I have 6 test jobs, which will have the above SMD.Static.DATAFILE as an i/p as well as one filename as i/p parameter.
If the i/p parameter is present in the file SMD.Static.DATAFILE and Indicator is Y then Return will be 0.
If the i/p parameter is present in the file SMD.Static.DATAFILE and Indicator is N then Return will be 4.
If the i/p parameter is not present in the file SMD.Static.DATAFILE then Return will be 8.


1. TestJob1 - i/p parameter ABC.XYZ.TESTJOAB.DATAFILE - Expected o/p is Return Code 0
2. TestJob2 - i/p parameter DEF.UVW.TESTJOCD.DATAFILE - Expected o/p is Return Code 4
3. TestJob3 - i/p parameter GHI.REW.TESTJOEF.DATAFILE - Expected o/p is Return Code 0
4. TestJob4 - i/p parameter PQR.ABC.TESTJOYZ.DATAFILE - Expected o/p is Return Code 8
5. TestJob5 - i/p parameter IJK.BMC.TESTJOGH.DATAFILE - Expected o/p is Return Code 4
6. TestJob6 - i/p parameter RST.SBS.TESTJOMN.DATAFILE - Expected o/p is Return Code 0

I can do the above with a Cobol program. But Can I do with a Sort?

In Cobol-

Create 6 jobs where create the below parameters as a PARM from the JCL and accept in Cobol program as Linkage section. Pass the SMD.Static.DATAFILE as an i/p filename. Search the parm parameter in the Static file in Cobol program and set the Return Code.

1. TestJob1 - i/p parameter ABC.XYZ.TESTJOAB.DATAFILE
2. TestJob2 - i/p parameter DEF.UVW.TESTJOCD.DATAFILE
3. TestJob3 - i/p parameter GHI.REW.TESTJOEF.DATAFILE
4. TestJob4 - i/p parameter PQR.ABC.TESTJOYZ.DATAFILE
5. TestJob5 - i/p parameter IJK.BMC.TESTJOGH.DATAFILE
6. TestJob6 - i/p parameter RST.SBS.TESTJOMN.DATAFILE
pinakimishra
 
Posts: 7
Joined: Thu Mar 07, 2019 6:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Search a filename in another file Using DFSORT

Postby pinakimishra » Tue Apr 02, 2019 8:41 pm

Nicc, Enrico,

Can you please suggest anything based on the Sample i/p and o/p? Please let me know if anything is not clear.
Thanks
Pinaki
pinakimishra
 
Posts: 7
Joined: Thu Mar 07, 2019 6:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Search a filename in another file Using DFSORT

Postby prino » Tue Apr 02, 2019 8:56 pm

Why are you still wasting our time with clear-as-mud requirements, when you could have written your COBOL program hours ago?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 583
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 26 times

Re: Search a filename in another file Using DFSORT

Postby Garry F Carroll » Wed Apr 03, 2019 4:08 pm

This can be done using DFSOST's ICETOOL e.g.

EXEC PGM=ICETOOL,PARM='JP1"XXX.REW.TESTJOEF.DATAFILE, Y"'
 


//TOOLIN    DD *                                                      
* ====================================================================
*                                                                    
 COUNT FROM(IN) EMPTY RC4 USING(CTL1)                                
*                                                                    
* ====================================================================
//CTL1CNTL DD *                                                      
*                                                                    
 INCLUDE COND=(1,47,SS,EQ,JP1)                                        
*                                                                    
 

*
This will return cond code 0 if found, cond code 4 if not.

You probably need to revise the INCLUDE statement to cater for positioning/length of the dataset name and the Y/N flag.

Garry.
Garry F Carroll
 
Posts: 26
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post