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
 

 

REFORMAT help needed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: REFORMAT help needed
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

Site Director


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

PostPosted: Thu Aug 12, 2010 10:54 pm    Post subject:
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: 500
Location: USA

PostPosted: Fri Aug 13, 2010 12:04 am    Post subject:
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: 500
Location: USA

PostPosted: Fri Aug 13, 2010 12:17 am    Post subject:
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

Site Director


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

PostPosted: Fri Aug 13, 2010 12:59 am    Post subject: Reply to: REFORMAT help needed
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    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 Help Needed with View Direct shailesh_do CA Products 2 Wed Jul 13, 2016 10:39 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts Reformat data into a sensible format prino DFSORT/ICETOOL 14 Tue Jan 19, 2016 6:00 pm
No new posts Information needed on using the COBAN... venugopal.dondla COBOL Programming 5 Thu Oct 08, 2015 3:34 pm
No new posts Reformat for specific values of a field vnktrrd DFSORT/ICETOOL 6 Wed Oct 07, 2015 1:04 pm


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