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

Convert DATE & COUNT to packed decimal S(9) comp-3 in DF


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

Senior Member


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

PostPosted: Tue Aug 23, 2011 10:42 pm
Reply with quote

rohanthengal,

Assuming your input LRECL is 80 and recfm=fb, the following DFSORT JCL will give you the desired results. I assumed you want the count also in PD format in pos 4 for a length of 8 bytes.

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
10001    JOHN BRIAN                                       
10002    ASHLEY GILES                                     
10008    STEFFY SHAW                                       
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC OVERLAY=(81:DATENS=(MD4),81,8,ZD,PD,LENGTH=5)     
  OUTFIL REMOVECC,BUILD=(1,80),                           
  HEADER1=('HDR',7:89,5),                                 
  TRAILER1=('TLR',COUNT=(PD,LENGTH=8))                     
//*
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: Tue Aug 23, 2011 10:51 pm
Reply with quote

Quote:
Hi Frank.. Just curiosity


Will below two have any performance difference...
Code:

//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,BUILD=(DATE1P)),
IFTHEN=(WHEN=INIT,BUILD=(C'PDATE,C''',1,5,C''''))
/*


Code:

//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,BUILD=(C'PDATE,C''',DATE1P,C''''))
/*


Sambhaji,

The answer to any and all such questions is one or more of the following:

1) It depends.
2) Your mileage may vary.
3) Try it yourself with the "relevant data" and see for yourself.

3) is usually the best answer.
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: Tue Aug 23, 2011 10:53 pm
Reply with quote

rohanthengal,

If you had explained clearly in your first post exactly what you wanted, we could have answered this in one reply. Please try to state your requirements more clearly in the future!
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Wed Aug 24, 2011 8:14 pm
Reply with quote

Thanks Frank, sqlcode1 ans Skolusu for your posts. It helped me a lot to write the datacard and get the results successfully. Hope it will run for future runs as well.

Thanks IBMMAINFRAMES, thanks a lot !

Also i regret for the troubles caused to you folks due to improper specification provided by me. I was also confused a lot due to changes in requirements stated at shop.

Sorry, now onwards will post the requirement only after it gets finalised.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top