View previous topic :: View next topic
|
Author |
Message |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi,
An input file has only two records.
Code: |
COUNT-1 IS: 45
COUNT-2 IS: 10326
|
How to create a single record out of it as below:
Code: |
COUNT-1 IS: 45 COUNT-2 IS: 10326
|
Please suggest.
Thanks. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
ramsri,
What's the input/output RECFM/LRECL. Also the maximum possible length of the numeric field? |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi,
The input file RECFM=FB and LRECL is 80. Its max possible length is 11 digits.
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
COUNT-1 IS: 45
COUNT-2 IS: 10326
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(8,1,CH) WITH(16,17) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(6,2,CH,EQ,C'-2'),BUILD=(16:1,17,80:X))
/*
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Code: |
----+----+----+----+----+
COUNT-1 IS: 12345678901
COUNT-2 IS: 12345678901
|
ramsri,
As the numeric field length is 11, you might want to modify the control cards as below.
Code: |
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(8,1,CH) WITH(25,23) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(6,2,CH,EQ,C'-2'),BUILD=(25:1,23,80:X))
/* |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I was apparently working on my solution while ramsri was posting about the 11 digits and didn't see that post until now. (I hate when that happens.) |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Frank & arcvns.
Thank you very much for your help.
|
|
Back to top |
|
|
|