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
 
How to SPLICE two records into a sigle record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Nov 18, 2008 9:24 pm    Post subject: How to SPLICE two records into a sigle record
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Tue Nov 18, 2008 10:10 pm    Post subject:
Reply with quote

ramsri,

What's the input/output RECFM/LRECL. Also the maximum possible length of the numeric field?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Nov 18, 2008 10:18 pm    Post subject: Reply to: How to SPLICE two records into a sigle record
Reply with quote

Hi,

The input file RECFM=FB and LRECL is 80. Its max possible length is 11 digits.

Thanks.
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 Nov 18, 2008 10:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Tue Nov 18, 2008 10:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Nov 18, 2008 11:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Nov 19, 2008 8:59 am    Post subject: Reply to: How to SPLICE two records into a sigle record
Reply with quote

Frank & arcvns.

Thank you very much for your help.

icon_biggrin.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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