Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DFSORT UTILITY HELP REQUIRED

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Bharath RajaramSridharan

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Mon Sep 29, 2014 12:27 pm    Post subject: DFSORT UTILITY HELP REQUIRED
Reply with quote

INPUT FILE - FBA 120
Code:
APPL ID: YYYYYYYYYYYYYY       VALID FROM: 21/11/06    STATUS: ACTIVE     
=========================     ====================    ================   
                                                                         
                                                   OPERATION DATA         
                                                   ==============         
                                                                         
OPERATION                               NUMBER   SPC     SMOOTH           
NAME NO  TEYT                     DUR   PS R1 R2 RES HRC FAC LIM JOBNAME 
-------- ------------------------ ----- -------- --- --- ------- --------
TSYS_001 PROCESS YYYYYYY1         00.01  1  0  0   0             YYYYYYY1
TSYS_002 PROCESS YYYYYYY2         00.01  1  0  0   0             YYYYYYY2
 
                                                                         
                                                                         
APPL ID: XXXXXXXXXXXXXX       VALID FROM: 21/11/06    STATUS: ACTIVE     
=========================     ====================    ================   
                                                                         
                                              INTERNAL OPERATION LOGIC
                                              ========================

WROTE THIS DFSORT TO GET THE FOLLOWING OUTPUT

Code:
//SORT000A EXEC PGM=SORT                                 
//SYSOUT   DD  SYSOUT=*                                   
//SORTIN   DD  DSN=INFILE,DISP=SHR     
//SORTOUT  DD  SYSOUT=*   
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INCLUDE COND=(36,05,CH,EQ,C'00.01')                     
  OUTREC BUILD=(15X,C',',02,08,C',',67,08,C',',11,23,80:X)
/*                                                       


OUTPUT
Code:
                     ,TSYS_001 ,YYYYYYY1,PROCESS YYYYYYY1
                     ,TSYS_002 ,YYYYYYY2,PROCESS YYYYYYY2


REQUIRED OUTPUT SHOULD HAVE THE APPLICATION ID ATTACHED TO EACH ROW. WAS PLANNING TO DO IN A SINGLE STEP. PLEASE HELP

OUTPUT REQUIRED - FB 80

Code:
YYYYYYYYYYYYYY       ,TSYS_001 ,YYYYYYY1,PROCESS YYYYYYY1
YYYYYYYYYYYYYY       ,TSYS_002 ,YYYYYYY2,PROCESS YYYYYYY2
Back to top
View user's profile Send private message

Bharath RajaramSridharan

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Mon Sep 29, 2014 12:42 pm    Post subject: DFSORT UTILITY HELP REQUIRED
Reply with quote

Hi, Actually got the output but took more than one step. Need to know if any technique available to reduce the number of steps.

Thanks!

Code:

//SORT0001 EXEC PGM=SORT                                       
//SYSOUT   DD  SYSOUT=*                                         
//SORTIN   DD  DSN=INFILE,DISP=SHR           
//SORTOUT  DD  DISP=(,PASS),DSN=&&SRT01,SPACE=(CYL,(10,10),RLSE)
//SYSIN    DD *                                                 
  SORT FIELDS=(01,15,CH,A)                                     
  SUM FIELDS=NONE                                               
  INCLUDE COND=(56,07,CH,EQ,C'STATUS:')                         
  INREC BUILD=(11,15,80:X)                                     
/*                                                             
//SORT0002 EXEC PGM=SORT                                       
//SYSOUT   DD  SYSOUT=*                                         
//SORTIN   DD  DSN=INFILE,DISP=SHR           
//SORTOUT  DD  DISP=(,PASS),DSN=&&SRT02,SPACE=(CYL,(10,10),RLSE)
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INCLUDE COND=(36,05,CH,EQ,C'00.01')                           
  OUTREC BUILD=(15X,C',',02,08,C',',67,08,C',',11,23,80:X)     
/*                                                             
//SORT0003 EXEC PGM=SORT                                       
//SYSOUT   DD  SYSOUT=*                                         
//SORTJNF1 DD  DISP=(OLD,PASS,DELETE),DSN=&&SRT01               
//SORTJNF2 DD  DISP=(OLD,PASS,DELETE),DSN=&&SRT02               
//SORTOUT  DD  SYSOUT=*                                         
//SYSIN    DD *       
  OPTION COPY                       
  JOINKEYS FILE=F1,FIELDS=(16,15,A)
  JOINKEYS FILE=F2,FIELDS=(01,15,A)
  REFORMAT FIELDS=(F1:1,15,F2:16,65)
  OUTREC BUILD=(1:1,80)             
/*                                                                           
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1650
Location: The Good Place

PostPosted: Mon Sep 29, 2014 1:56 pm    Post subject:
Reply with quote

Hello,
You could try this below code,
Code:
 OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,8,CH,EQ,C'APPL ID:'),
  PUSH=(121:11,14))
  OUTFIL FNAMES=SORTOUT,INCLUDE=(36,05,CH,EQ,C'00.01'),
  BUILD=(121,14,C',',02,08,C',',67,08,C',',11,23,80:X)

My DFSORT is a little rusty at the moment, oiling up.
Output:
Code:
YYYYYYYYYYYYYY,TSYS_001,YYYYYY1 ,PROCESS YYYYYYY1
YYYYYYYYYYYYYY,TSYS_002,YYYYYY2 ,PROCESS YYYYYYY2

Hope it helps.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COMPUSET/XICS z/os document required Nic Clouston All Other Mainframe Topics 1 Tue Sep 03, 2019 12:42 pm
No new posts Need advise in calling DFSORT from REXX ajithajt CLIST & REXX 9 Thu Nov 29, 2018 10:50 am
No new posts How to handle different file length b... javen777 DFSORT/ICETOOL 15 Mon Nov 26, 2018 12:13 pm
No new posts How to count the number of times key ... vnktrrd DFSORT/ICETOOL 14 Thu Nov 15, 2018 9:19 pm
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us