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
 

 

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 Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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