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

Creating Muntiple HEADER and TRAILER


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
AtanuTagore

New User


Joined: 29 May 2009
Posts: 3
Location: Pune, India

PostPosted: Fri May 29, 2009 4:07 pm
Reply with quote

Hi,
Needed some help, I need to use sort to create a Control Card(PS file).
Requirement: The output file should look like:

SIGNON USERID=(XX) ESF=YES CASE=YES
SUBMIT PROC=P1EJMND1 -
&INDSN01='P1EJ.CP000000.PGBR.FFB.AUTH(0)' -
&OUTDSN01='/ftp/whirl_sas/data/0709.hsbc.hbme.cr.aut.'
SIGNOFF


The bold parts
This part would be coming from the 4 bytes from the 24 th position of the input file.

My approach:

[color=red]SORT FIELDS=COPY,
SKIPREC=1
OUTFIL HEADER1=(4:'SIGNON USERID=(XX) ESF=YES ASE=YES'),
NODETAIL,REMOVECC,
HEADER2=(4:'SUBMIT PROC=P1EJMND1 -'),
TRAILER1=(4:'&INDSN01='P1EJ.CP000000.PGBR.FFB.AUTH(0)' -'),
TRAILER2=(4:'INCLUDE COND=(/FTP/WHIRL_SAS/DATA/,''24,4,'',
.HSBC.HBME.CR.AUT')'),
TRAILER3=(4:' SIGNOFF ')


Now when I run the job the error that comes out is:

E1 8 DSS10083E SYNTAX ERROR; ')' WAS EXPECTED.
E2 8 DSS10058E SYNTAX ERROR; PARSING STOPPED AT '' -''.


(I am posting for the 1st time, sry if its not in a proper way.)
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri May 29, 2009 8:44 pm
Reply with quote

I don't know why you're using all of those different HEADER and TRAILER operands. I can't really tell what you're trying to do.

Please show an example of the records in the input file. Also, tell me the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 29, 2009 9:58 pm
Reply with quote

Use the following JCL which will give you the desired results. I assumed that you only hae 1 record in your input file and the only fields you are interested is in pos 24 for 4 bytes. You just need the / to create multiple lines


Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
                       0709                                         
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  OPTION COPY,STOPAFT=1                                             
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                             
  HEADER1=('SIGNON USERID=(XX) ESF=YES CASE=YES',/,                 
           'SUBMIT PROC=P1EJMND1 - ',/,                             
           '&INDSN01=''','P1EJ.CP000000.PGBR.FFB.AUTH(0)''',' - ',/,
           '&OUTDSN01=''','/ftp/whirl_sas/data/',24,4,               
           '.hsbc.hbme.cr.aut.''',/,                                 
           'SIGNOFF')                                               
/*
Back to top
View user's profile Send private message
AtanuTagore

New User


Joined: 29 May 2009
Posts: 3
Location: Pune, India

PostPosted: Mon Jun 01, 2009 2:33 pm
Reply with quote

Hi Skolusu/Frank,
Thank you both for your reply, I really appreciate it.

Skolusu, the JCL worked just fine, but I had a couple of questions about the SYSIN:
1) Is OPTION same as SORT FIELDS, here it is used for COPY only can it be used for conditions also?
2) What does BUILD do here?
Thanks again..
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jun 01, 2009 9:22 pm
Reply with quote

AtanuTagore wrote:
Hi Skolusu/Frank,
Thank you both for your reply, I really appreciate it.

Skolusu, the JCL worked just fine, but I had a couple of questions about the SYSIN:
1) Is OPTION same as SORT FIELDS, here it is used for COPY only can it be used for conditions also?
2) What does BUILD do here?
Thanks again..


1. OPTION COPY is equivalent to SORT FIELDS=COPY. STOPAFT=1 says to copy only the first record.

2. The build statement ensures that the output file is created with LRECL=80 (in case your input file does not have LRECL=80).
Back to top
View user's profile Send private message
AtanuTagore

New User


Joined: 29 May 2009
Posts: 3
Location: Pune, India

PostPosted: Tue Jun 02, 2009 9:53 am
Reply with quote

Thank you so much Skolusu, it was a lot of help.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Creating CSV file from Variable recs ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top