Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Different layout in single output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Different layout in single output
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

Site Director


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

PostPosted: Tue Feb 24, 2009 10:15 pm    Post subject:
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 Moderator


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

PostPosted: Tue Feb 24, 2009 10:17 pm    Post subject:
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    Post subject: Reply to: Different layout in single output
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

Site Director


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

PostPosted: Wed Feb 25, 2009 9:04 pm    Post subject:
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 Moderator


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

PostPosted: Wed Feb 25, 2009 10:05 pm    Post subject:
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    Post subject: Reply to: Different layout in single output
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    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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 3 Mon Mar 27, 2017 3:59 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us