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

Formatting using DFsort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Guru Nandu

New User


Joined: 16 Jul 2009
Posts: 6
Location: India

PostPosted: Thu Nov 30, 2017 7:33 am
Reply with quote

Hi,

If input file in variable length record as shown below

12073
12083
1208345
120834

Using DFSORT/ICETOOL, Can we format as sample provided below
AAA
BBB
CCC:YYMMDD001
XXX12073YY
XXX12073YY
XXX1208345YY
XXX120834YY
zzz
ggg04

Line 1: where AAA is a static header 1
Line 2: Where BBB is static header 2
Line 3: where CCC is static and YY is year, MM is month and DD is date and 999 is static number - This is header 3
Line 4:
where XXX is static value.
include the record 12073
YY is picked from that record(12073) 3:2 (07)
All the remaining records in input file will use the above logic stated in Line 4
Line 8: Trailer1 must contain static value zzz
Line 9: Trailer1 must contain static value ggg and 04 is the total count
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Nov 30, 2017 5:50 pm
Reply with quote

Please use the code tags. It is a data set not a 'file'.

I believe that it can be done - what have your tried so far?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2028
Location: USA

PostPosted: Fri Dec 01, 2017 2:26 am
Reply with quote

Guru Nandu wrote:
Hi,



This forum is not supposed for you to place YOUR OWN TASK here, expecting to get the solution of YOUR TASK from others.

This forum is supposed for you to place the results of YOUR OWN ATTEMPT to do your own job - in case the received results are somehow not what is expected.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Sun Dec 03, 2017 1:16 pm
Reply with quote

Guru Nandu,

What is the maximum record length of your variable file.

I assumed it as 16 and developed the code UNTESTED, you may need to modify according to your requirements.

Code:

//STEP01  EXEC PGM=SORT                             
//SYMNAMES DD *                                     
HDATE,S'&LYR2.&LMON.&LDAY.'                         
//SORTIN  DD DISP=SHR,DSN=INPUT.FILE             
//SORTOUT DD DISP=(,CATLG,DELETE),                 
//           SPACE=(CYL,(10,10),RLSE),             
//           DSN=OUTPUT.FILE                   
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *
  OPTION COPY                                                     
  INREC OVERLAY=(08:5,16,
                 05:C'XXX',
                 21:10,2,
                 05:5,21,SQZ=(SHIFT=LEFT))
 
  OUTFIL HEADER1=(C'AAA',/,
                  C'BBB',/,
                  C'CCC:',HDATE,C'001'),         
         
         TRAILER1=(C'ZZZ',/,
                   C'GGG',
                   COUNT=(EDIT=(TT))),             
         REMOVECC                                                     
                                     
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2028
Location: USA

PostPosted: Mon Dec 04, 2017 8:23 pm
Reply with quote

//SYMNAMES DD cannot handle parameters, except exported JCL SET-variables

Without any demonstrated results produced by your own code, either correct or incorrect ones, nobody in this forum is going to do your own job instead of yourself. Period.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Dec 05, 2017 12:31 am
Reply with quote

Similar post(s) are discussed before over internet, why is self research missing here? You wait till someone do the work for you and you just don't learn?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts DFSORT GUID DFSORT/ICETOOL 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top