MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFSORT solution needed

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Jaya
Beginner


Joined: 02 Sep 2005
Posts: 77
Topics: 10
Location: Cincinnati

PostPosted: Fri Feb 10, 2006 1:36 am    Post subject: DFSORT solution needed Reply with quote

Hi

I would like to know whether DFSORT ICETOOL solution is possible for the following requirement.

Input file format
Code:
----+----1----+----2----+----3----+----4
0  AAAAAAAA  STRUCTURE             
       1750                             
         CB  DESCRIPTION                   
          1590M38G05                   
0  BBBBBBBB  STRUCTURE1             
       1725                             
         C2  DESCRIPTION1           
          9526M95G03                   
          9527M90G06                   
          9524M32P01                   
          9526M92P02                   


Required output format
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
          1590M38G05    AAAAAAAA  STRUCTURE    1750    CB  DESCRIPTION           
          9526M95G03    BBBBBBBB  STRUCTURE1   1725    C2  DESCRIPTION1           
          9527M90G06    BBBBBBBB  STRUCTURE1   1725    C2  DESCRIPTION1                 
          9524M32P01    BBBBBBBB  STRUCTURE1   1725    C2  DESCRIPTION1                 
          9526M92P02    BBBBBBBB  STRUCTURE1   1725    C2  DESCRIPTION1     



The Input file has 4 record types.
type 1 --starts with 0 in column 1 and non space in column 4
type 2 --Starts with Non space in column 8
type 3 --starts with Non space in column 10
type 4 --starts with Non space in column 11

Record type 4 can repeat N times in the input file. I need all type 4 records in the output file with the corresponding other 3 type data to its right as mentioned above.

Please advise.

Thanks,
Jaya.
_________________
"Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Fri Feb 10, 2006 3:40 am    Post subject: Reply with quote

Jaya,

What is the logic to join the four 1st records into one and to propagate the B's for the other one ?. Do we have to test STRUCTURE/STRUCTURE1 to know.

Could you be more clear about that

Alain
Back to top
View user's profile Send private message
Jaya
Beginner


Joined: 02 Sep 2005
Posts: 77
Topics: 10
Location: Cincinnati

PostPosted: Fri Feb 10, 2006 5:04 am    Post subject: Reply with quote

Alain,
Thanks for your time
In the given input file:

First record = type 1
second record = type 2
Third record = type 3
fouth record = type 4
fifth record = type 1
sixth record = type 2
seventh record = type 3
records 8-11 = type 4

The number of type 4 records can vary but the input file will be in the same sequence
i.e 1-2-3-4 or 1-2-3-4-4 or 1-2-3-4-4-4-4 ..
I need to group them in blocks and summarise each block to a single output record.

An occurence of type 1 record in the input file signifies the end of previous block that needs
to be summarised.

For Every type 4 input record, there should be an output record.

Hope i am clear on my requirement.
We have a cobol solution but just wandering for a JCL workaround.

Thanks in advance,
Jaya.
_________________
"Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Feb 10, 2006 10:16 am    Post subject: Reply with quote

Jaya,

How do you distinguish record types? is there a string any where in the record which distingushes the record types?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Feb 10, 2006 11:52 am    Post subject: Reply with quote

Jaya,

Here's a DFSORT/ICETOOL job that will do what you asked for.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T3 DD DSN=&&T3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T3,VOL=REF=*.T3,DISP=(OLD,PASS)
//    DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(T3) ON(81,8,ZD) -
  WITHEACH WITH(48,4) WITH(56,16)
SPLICE FROM(CON) TO(OUT) ON(81,8,ZD) -
  WITHALL WITH(11,10) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'0'),
                OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(89:SEQNUM,8,ZD,
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  OUTREC OVERLAY=(89:SEQNUM,8,ZD,RESTART=(81,8))
  OUTFIL FNAMES=T1,INCLUDE=(89,8,ZD,LE,+3),
         IFTHEN=(WHEN=(89,8,ZD,EQ,+1),
           BUILD=(25:4,20,81:81,16)),
         IFTHEN=(WHEN=(89,8,ZD,EQ,+2),
           BUILD=(48:8,4,81:81,16)),
         IFTHEN=(WHEN=(89,8,ZD,EQ,+3),
           BUILD=(56:10,16,81:81,16))
  OUTFIL FNAMES=T2,SAVE
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,75)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jaya
Beginner


Joined: 02 Sep 2005
Posts: 77
Topics: 10
Location: Cincinnati

PostPosted: Mon Feb 13, 2006 11:25 pm    Post subject: Reply with quote

Kolusu/Frank,

Sorry! for the late reply as i had a long weekend ( Enjoying IND VS PAk cricket match - Good one)

Frank,
This is an amazing stuff....U are too great!!
Thank you very much..

Frank/Kolusu,
I am very much impressed with your replies in this site, that too in no time. You are doing a real great job in building confidence on the mainframe professionals. U guys will be remembered for ever.



Thanks,
Jaya.
_________________
"Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group