Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
FIELD of one file to another file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
star_dhruv2000

Active User


Joined: 03 Nov 2006
Posts: 75
Location: India

PostPosted: Mon Jun 16, 2008 9:37 pm    Post subject: FIELD of one file to another file
Reply with quote

Hi all,

I have two files namely FILE1 and FILE2. Following is structure of files:

FILE1:
Code:

TYPE1 2008-06-16 108


FILE2: (LAST REC)
Code:

TOTAL RECORDS: 000198


Now I want to move "108" from FILE1 to last rec of FILE2 as following

FILE2:
Code:

TOTAL RECORDS: 000198     108


Hope I am cler with my issue. Thank in advance

Cheers
Back to top
View user's profile Send private message
References
PostPosted: Mon Jun 16, 2008 9:37 pm    Post subject: Re: FIELD of one file to another file Reply with quote

Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Jun 17, 2008 12:49 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
TYPE1 2008-06-16 108
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PAS
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'TARG,''',18,3,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
RECORD 01
RECORD 02
...
TOTAL RECORDS: 000198
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,14,CH,EQ,C'TOTAL RECORDS:'),
    OVERLAY=(27:TARG))
/*
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1