Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort to write static and dynamic fields

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

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Wed Mar 03, 2010 5:43 pm    Post subject: Syncsort to write static and dynamic fields
Reply with quote

I have an input file with the date field. The format is 20100303.
I need to write an output file with the content as below:

FILE NAME CONSUMER.XXXXXXXX.PGP , where XXXXXXXX is dynamic and will be fetched from the input file. The other values (in red) are always static and also need to be populated in the output file. Hope I'm clear.
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Mar 03, 2010 5:56 pm    Post subject:
Reply with quote

Hi,

this will do the trick, assuming the the output LRECL is 80
Code:
//S1       EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
20100303.                                                           
/*                                                                   
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  OUTREC BUILD=(C'FILE NAME CONSUMER.',1,8,C'.PGP',80:X)             
/*                                                                   



Gerry
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: Wed Mar 03, 2010 8:35 pm    Post subject:
Reply with quote

Hello,

If the Xs are supposed to contain the date from the input file, it could be used for a Windows/UNIX file, but that would be an invalid dataset name on the mainframe.
Back to top
View user's profile Send private message
annu zacson

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Thu Mar 04, 2010 10:25 am    Post subject: Syncsort to write static and dynamic fields
Reply with quote

Thanks Gerry..

This worked.. icon_biggrin.gif
Back to top
View user's profile Send private message
annu zacson

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Thu Mar 04, 2010 10:37 am    Post subject: Syncsort to write static and dynamic fields
Reply with quote

Hi,

Now i got one line in the output file as below:

FILE NAME CONSUMER.20100303.PGP

Is it possible to write one more line in the output file as below from the same input file.

FILE NAME CONSUMER.20100303.PGP
DATE OF REPORTING 20100303


Thanks
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Mar 04, 2010 11:42 am    Post subject:
Reply with quote

Hi,

try this
Code:
//S1       EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
20100303.                                               
/*                                                     
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  OPTION COPY                                           
  OUTFIL OUTREC=(C'FILE NAME CONSUMER.',1,8,C'.PGP',/, 
                C'DATE OF REPORTING ',1,8,80:X)         


Gerry
Back to top
View user's profile Send private message
annu zacson

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Thu Mar 04, 2010 3:15 pm    Post subject: Syncsort to write static and dynamic fields
Reply with quote

Thanks Gerry..this worked..
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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
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 Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us