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

REFORMAT help needed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venkatatcts

New User


Joined: 16 Mar 2009
Posts: 55
Location: India

PostPosted: Thu Aug 12, 2010 8:49 pm
Reply with quote

Hi,

I have three input file and it as a common key. The key starts from position 17 for the first input file and for the third input file it starts from position 53.

I need to extract the key alone from the 3 files and write it to a separate file.

I tried the following,

Code:

//SORTJNF1 DD  DSN=XXXXXX.XXXXX.XXX(0),DISP=SHR    - Key from 17 and length of 8
//                 DD  DSN=XXXXX.XXXXXX.XX(0),DISP=SHR  -Key from 17 and length of 8

//SORTJNF2 DD  DSN=XXXXX.XXXXXX.XXX(0),DISP=SHR   - Key from 53 and length of 8
//SORTOUT  DD  DSN=XXXXX.XXXXXX.XXXX,               
//             DISP=(NEW,CATLG,DELETE),                           
//             UNIT=SYSALLDA,SPACE=(CYL,(10,5),RLSE),             
//             DCB=(LRECL=8,BLKSIZE=0,RECFM=FB)                   
//SYSOUT   DD  SYSOUT=*                                           
//SYSPRINT DD  SYSOUT=*                                           
//CAIPRINT DD  SYSOUT=*                                           
//SYSUDUMP DD  SYSOUT=*                                           
//*                                                               
//SYSIN    DD  *                                         
   JOINKEYS FILES=F1,FIELDS=(17,8,A)                     
   JOINKEYS FILES=F2,FIELDS=(53,8,A)                     
   JOIN UNPAIRED,F1,F2                                   
   REFORMAT FIELDS=(F1:17,8,F2:53,8)                     
   SORT FIELDS=COPY,                                     
      DYNALLOC=(SYSDA,32),SIZE=E50000                     
   OUTFIL FILES=(OUT),                                   
   OUTREC=(1,8)                                           
/*                                                       


But I am not getting the expected result. I could guess that join reformat is not the correct syntax. But Please let me know any good idea to do this.

Thanks,
Venkat
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: Thu Aug 12, 2010 10:54 pm
Reply with quote

Hello,

You mention 3 files - but do not explain three, only 2.

The explanation is completely lacking. . . What are the recfm and lrecls of the files? What is the "expected result"?

Suggest you show some sample input data and the output you want from that input. Show the informational output generated by the job.

Saying "it doesn't work" just wastes everyone's time. . .
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Aug 13, 2010 12:04 am
Reply with quote

Dick - Venkat has concatentated 2 datasets in SORTJNF1. I believe those 2 files plus the SORTJNF2 file makes up the 3 input files he is referring to.

Venkat - Your control statements can be simplified as follows:
Code:
//SYSIN    DD  *                                         
   JOINKEYS FILES=F1,FIELDS=(17,8,A)                     
   JOINKEYS FILES=F2,FIELDS=(53,8,A)                     
   JOIN UNPAIRED
   REFORMAT FIELDS=(F1:17,8)                     
   SORT FIELDS=COPY,                                     
      DYNALLOC=(SYSDA,32)                         
/*   

However, since your JCL was not giving you the expected output, please show us some sample input records (from each of the 3 files) and what your desired output would be from those records as Dick had requested. This will help us to better assist you.

Regards,
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Aug 13, 2010 12:17 am
Reply with quote

If all you want is the 8-byte field from the unpaired records, these control statements should work for you:
Code:
//SYSIN    DD  *                                         
   JOINKEYS FILES=F1,FIELDS=(17,8,A)                     
   JOINKEYS FILES=F2,FIELDS=(53,8,A)                     
   JOIN UNPAIRED,ONLY
   REFORMAT FIELDS=(F1:17,8,F2:53,8)                     
   SORT FIELDS=COPY
   OUTFIL OUTREC=(1,8,/,9,8)                       
/*   

Give that a try and let us know if that gives you the desired output. If not, please see the previous posts.

Regards,
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: Fri Aug 13, 2010 12:59 am
Reply with quote

Hi Alissa,

Quote:
I believe those 2 files plus the SORTJNF2 file makes up the 3 input files he is referring to.
I believe so also now that you mention it. . .

I was reading the comments rather than the jcl. . . icon_redface.gif

d
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts Reformat and relocate content DFSORT/ICETOOL 4
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
Search our Forums:

Back to Top