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
 
Displaying number, word and date in a flat file using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Displaying number, word and date in a flat file using SORT
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: 500
Location: USA

PostPosted: Mon Feb 25, 2008 10:20 pm    Post subject:
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 Moderator


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

PostPosted: Mon Feb 25, 2008 10:21 pm    Post subject:
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    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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

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