IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

INPFIL FILES, FNAMES examples


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kris_madras

New User


Joined: 04 Jul 2005
Posts: 50

PostPosted: Thu Mar 05, 2026 2:09 pm
Reply with quote

I think INPFIL feature is only in syncsort. This allows to read multiple input files which are different attributes. I tried to run using INPFIL in SORT but it is not working.


Code:
//STEP001  EXEC PGM=SORT             
//SORTIN1  DD  DSN=ABC,DISP=SHR     
//SORTIN2  DD  DSN=XYZ,DISP=SHR     
//SORTOUT  DD  SYSOUT=*             
//SYSOUT  DD SYSOUT=*               
//SYSIN   DD *                       
  INPFIL FILES=(1,2)                 
  SORT FIELDS=COPY 



I am getting error "DSS20011E DD 'SORTIN' WAS NOT ALLOCATED"
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2286
Location: USA

PostPosted: Thu Mar 05, 2026 9:52 pm
Reply with quote

RTFM
In this case it's enough just to read English!

Nothing to add here...
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2286
Location: USA

PostPosted: Thu Mar 05, 2026 10:48 pm
Reply with quote

FYI:
Quote:
Using control statements from other IBM programs

The INPFIL control statement, which is used by other IBM sort programs, is accepted but not processed.


Quote:
Input data sets—SORTIN and SORTINnn

DFSORT processes two types of input data sets, referred to as the SORTIN data set (or just SORTIN) and the SORTINnn data sets (or just SORTINnn).

The SORTIN DD statement specifies the input data set (or concatenated input data sets) for a sort or copy application. If a SORTIN DD statement is present, it will be used by default for a sort or copy application unless you invoke DFSORT from a program with the address of an E15 user exit in the parameter list.

The SORTINnn DD statements (where nn can be 00 to 99) specify the data sets for a merge application. If a SORTINnn DD statement is present, it will be used by default for a merge application unless you invoke DFSORT from a program with the address of an E32 user exit in the parameter list.

“Data set considerations ” on page 13 contains general information about input data sets. For specific information about the SORTIN data set, see “SORTIN DD statement” on page 66 . For specific information about the SORTINnn data sets, see “SORTINnn DD statement” on page 68 .


P.S.
Your question is about DFSORT, but placed under SYNCSORT forum.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1442
Location: Bamberg, Germany

PostPosted: Fri Mar 06, 2026 9:14 pm
Reply with quote

I was playing around a bit avoiding the need for SYNCTOOL/ICETOOL and JOIN operations. Maybe not the best solution, but should work up to the limit of SORTINnn datasets. IIRC every input dataset has just one line.

Code:
//WHATEVER EXEC PGM=ICEMAN,PARM='MSG=NO'               
//SORTIN01 DD *                                       
BANGOR, MAINE                                         
/*                                                     
//SORTIN02 DD *                                       
              USA                                     
/*                                                     
//SORTIN03 DD *                                       
PARIS, TEXAS                                           
/*                                                     
//SORTIN04 DD *                                       
              United States                           
/*                                                     
//SYSOUT   DD SYSOUT=*                                 
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  OPTION VLSCMP                                       
  DEBUG ABEND,NOESTAE                                 
  INREC IFTHEN=(WHEN=INIT,                             
    OVERLAY=(50:SEQNUM,8,BI,START=0)),                 
    IFTHEN=(WHEN=GROUP,BEGIN=(57,1,BI,EQ,B'.......0'),
      PUSH=(1,14),RECORDS=2)                           
  MERGE FIELDS=(50,8,BI,A)                             
  OUTFIL FNAMES=(SORTOUT),                             
    INCLUDE=(57,1,BI,EQ,B'.......1'),                 
    REMOVECC,                                         
    BUILD=(1,49)                                       
  END                                                 
/*


Code:
****** ***************************** Top of Data ****
000001 BANGOR, MAINE USA                             
000002 PARIS, TEXAS  United States                   
****** **************************** Bottom of Data ***
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2286
Location: USA

PostPosted: Fri Mar 06, 2026 9:30 pm
Reply with quote

Cannot imagine real business requirements with such input data design...

Code:
//SORTIN01 DD *                                       
BANGOR, MAINE                                         
/*                                                     
//SORTIN02 DD *                                       
              USA                                     
/*                                                     
//SORTIN03 DD *                                       
PARIS, TEXAS                                           
/*                                                     
//SORTIN04 DD *                                       
              United States                           
/*


Maybe only as a game? Or initial training for school students?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1442
Location: Bamberg, Germany

PostPosted: Fri Mar 06, 2026 9:42 pm
Reply with quote

It looks very strange to have such constructs, that is definitely true. icon_biggrin.gif
Back to top
View user's profile Send private message
kris_madras

New User


Joined: 04 Jul 2005
Posts: 50

PostPosted: Mon Mar 09, 2026 9:20 am
Reply with quote

Thanks for the feedback and solutions. Let me give a try.
Actually, I was looking for solution to read in from multiple input files and reformat separately and write to different output files and one for each.

Code:
SORTIN01 --> REFORMAT1 --> SORTOUT01
SORTIN02 --> REFORMAT 2--> SORTOUT02
..........
SORTIN10 --> REFORMAT10 --> SORTOUT10
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2286
Location: USA

PostPosted: Mon Mar 09, 2026 5:08 pm
Reply with quote

kris_madras wrote:
Thanks for the feedback and solutions. Let me give a try.
Actually, I was looking for solution to read in from multiple input files and reformat separately and write to different output files and one for each.

Code:
SORTIN01 --> REFORMAT1 --> SORTOUT01
SORTIN02 --> REFORMAT 2--> SORTOUT02
..........
SORTIN10 --> REFORMAT10 --> SORTOUT10

Even more strange requirement...
Like hammering nails using a microscope. It is possible, but... icon_pray.gif
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts JCL to merge two files side by side DFSORT/ICETOOL 3
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
Search our Forums:


Back to Top