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

Different layout in single output


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

New User


Joined: 07 Jan 2007
Posts: 13
Location: INDIA

PostPosted: Tue Feb 24, 2009 5:15 pm
Reply with quote

Hi,

I have one input dataset, which contains two different layouts of records. I need to convert numeric amount form to text form in output. Amount positions are different in two layouts. When writing to output I want it to be in single output.


Input record contains two layouts, One layout contains Word "Offset" and then set of next layout records. So is there any chance to write condition based on this "offset" keyword.

Presently I am using JCL that is converting and splitting both layout records in to two outputs (using OUTFIL), and finally I am merging manually. Please help me.

Thanks,
Soundar.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 24, 2009 10:15 pm
Reply with quote

Hello,

You need to post some sample input, the output you want from that input, and the "rules" to get from the input to the output.

Also include the recfm and lrecl of the files.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 24, 2009 10:17 pm
Reply with quote

You can use IFTHEN clauses to handle different record layouts in different ways. But if you want more specific help on this, you need to show an example of the records in your input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.

Quote:
Presently I am using JCL that is converting and splitting both layout records in to two outputs (using OUTFIL), and finally I am merging manually


Show the control statements you're using to do create the two outputs. That might make it easier to show you how to convert them to IFTHEN clauses.
Back to top
View user's profile Send private message
Soundararajan

New User


Joined: 07 Jan 2007
Posts: 13
Location: INDIA

PostPosted: Wed Feb 25, 2009 11:50 am
Reply with quote

Dick and Frank,

My input contains two different layouts,

1) Offset layout (Which contains keyword OFFSET in position 9-14)
2) Detail layout

Both are of record length 400 bytes. But using different copybooks.

I need to convert Amount fields to text format and remaining fields need to write to output as it is.

Please find the sort card, which I am using presently.

//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(9,6,CH,EQ,C'OFFSET'),
OUTREC=(1,37,38,13,ZD,M26,
51,13,ZD,M26,
64,77,
141,13,ZD,M26,
154,247)

OUTFIL FILES=02,
INCLUDE=(9,6,CH,NE,C'OFFSET'),
OUTREC=(1,61,62,10,ZD,M26,
72,10,ZD,M26,
82,319,1X)

Offset layout contains three amount fields and detail layout contains two amount fields. My output length is 403. Set of detail records contains one offset. Input contains different sets of these.

Thanks,
Soundar.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 25, 2009 9:04 pm
Reply with quote

Hello,

You need to post some sample input data in addition to the description along with the output you want from that exact sample data.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Feb 25, 2009 10:05 pm
Reply with quote

Soundar,

Using your OUTFIL statements as a guide, I constructed this DFSORT job using IFTHEN clauses that should do what you want in one pass.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/400)
//SORTOUT DD DSN=...  output file (FB/400)
//SYSIN    DD    *
    SORT FIELDS=COPY
    OUTREC IFTHEN=(WHEN=(9,6,CH,EQ,C'OFFSET'),
       BUILD=(1,37,38,13,ZD,M26,
              51,13,ZD,M26,
              64,77,
              141,13,ZD,M26,
              154,247)),
     IFTHEN=(WHEN=NONE,
       BUILD=(1,61,62,10,ZD,M26,
                 72,10,ZD,M26,
                 82,319,1X))
/*
Back to top
View user's profile Send private message
Soundararajan

New User


Joined: 07 Jan 2007
Posts: 13
Location: INDIA

PostPosted: Thu Feb 26, 2009 12:03 pm
Reply with quote

Thank you very much Frank for your valuable solution. Its working great and it saves time for manual merging of the two datasets. Thanks a lot.

Regards,
Soundar.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
Search our Forums:

Back to Top