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

Displaying number, word and date in a flat file using SORT


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

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Mon Feb 25, 2008 2:07 pm
Reply with quote

Hi,

In a flat file, I just want to have a Serial number '1' (COMP - 4 bytes), then the sentence 'BATCH STARTED' (50 bytes) and then the todays date (10 bytes).

I had written the SORT step as
Code:
 
//STEP1    EXEC PGM=SORT                                             
//SORTIN   DD DUMMY,LRECL=64,RECFM=FB
//SORTOUT  DD DSN=VPT.USUVSN9.TPA.FEB25,                             
//            DISP=(,CATLG,DELETE),                               
//            SPACE=(CYL,(20,20),RLSE)
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  OUTFIL HEADER1=(1:C'1',BI,5:C'UC-21 BATCH STARTED',55:&DATE=(4MD-)),REMOVECC
/*

Since DUMMY is used for input file, we wont be able to use simple OUTREC and i used HEADER1 instead.

But I am not able to have the serial number as the first 4 bytes (binary COMP). So is there any other way to have this.

Thanks
Raj
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Feb 25, 2008 10:20 pm
Reply with quote

If my understanding is correct, and you do not want the serial number in printable format, but rather binary, then try the following:
Code:

OUTFIL HEADER1=(1:X'00000001',5:C'UC-21 BATCH STARTED',
               55:&DATE=(4MD-)),REMOVECC                           
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: Mon Feb 25, 2008 10:21 pm
Reply with quote

Quote:
just want to have a Serial number '1' (COMP - 4 bytes)


Quote:
But I am not able to have the serial number as the first 4 bytes (binary COMP). So is there any other way to have this.


Yes, but it's not clear what exactly you want in those 4 bytes. '1' is X'F1' which takes 1 byte. Do you actually want a binary 1 = X'00000001'? If so you can use:

Code:

  OUTFIL HEADER1=(1:X'00000001', 
     5:C'UC-21 BATCH STARTED',   
     55:&DATE=(4MD-)),           
     REMOVECC                   


Or do you want '1' and then 3 blanks? If so, you can use 1:C'1',5:...

Or do you want something else? If so, show what you want in hex.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top