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
 
Squeeze parameter with edit mask in dfsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Wed Dec 08, 2010 11:46 am    Post subject: Squeeze parameter with edit mask in dfsort
Reply with quote

I have an input file which looks like the following:

0001000120100010000400000000000000000000000000
0001000220100010000400000000000000000000000000
0001000320100010000400000000000140000001905215
0001000420100010000400000000000700000000000898
0001000520100010000400000000000430000000000792
0001000620100010000400000000000000000000000000
0001000720100010000400000000000000000000000000


The input file format is as follows:

Field Start Length Type

OUT-DEPT 1 4 Num
OUT-LOC 5 4 Num
OUT-YR-I 9 4 Num
OUT-MO-I 13 4 Num
OUT-MO-WK-I 17 4 Num
OUT-SUM-CMTD 21 13 Num
OUT-SUM-CYTD 34 13 Num


I want the output file in the following format:

"PURCHASES","0001","0001","2010","0010","0004","0","0"
"PURCHASES","0001","0002","2010","0010","0004","0","0"
"PURCHASES","0001","0003","2010","0010","0004","0.14","19052.15"
"PURCHASES","0001","0004","2010","0010","0004","0.70","8.98"
"PURCHASES","0001","0005","2010","0010","0004","0.43","7.92"
"PURCHASES","0001","0006","2010","0010","0004","0","0"
"PURCHASES","0001","0007","2010","0010","0004","0","0"


PURCHASES is to be added into the output file.
The quotes are been able to be inserted with Squeeze parameter but the last two fields i am not able to get.

The last two fields are numeric which has length 13.
In the output file it should be in the format 9(11)v9(2).
If the data is 0000000000000 then output file should contain "0".
If the data is 0000000000022 then output file should contain "0.22".
If the data is 0000000010022 then output file should contain "100.22".
If the data is 0000000010000 then output file should contain "100" because here the data is 100.00.


For the starting fields the control card i used for the job is below:

//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:1,17,SQZ=(SHIFT=LEFT,LE
18:5,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
25:9,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
32:13,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
39:18,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
46:23,16,ZD,SQZ=(SHIFT=LEFT,LEAD=C'","'))
/*

Please can you help me to get the output file in the above specified format?
Back to top
View user's profile Send private message

Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Wed Dec 08, 2010 12:34 pm    Post subject:
Reply with quote

There is a correction in the sort card:

//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:1,17,SQZ=(SHIFT=LEFT,LE
18:5,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
25:9,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
32:13,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
39:18,7,SQZ=(SHIFT=LEFT,LEAD=C'","'),
46:23,16,SQZ=(SHIFT=LEFT,LEAD=C'","'))
/*

And the output i obtained is as follows:

"PURCHASES","0001","0001","2010","0010","0040","0000000000000
"PURCHASES","0001","0002","2010","0010","0040","0000000000000
"PURCHASES","0001","0003","2010","0010","0040","0000000001400
"PURCHASES","0001","0004","2010","0010","0040","0000000007000
"PURCHASES","0001","0005","2010","0010","0040","0000000004300
"PURCHASES","0001","0006","2010","0010","0040","0000000000000
"PURCHASES","0001","0007","2010","0010","0040","0000000000000


Looking forward for the answer and sorry for the correction.


Thank you.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Wed Dec 08, 2010 5:16 pm    Post subject:
Reply with quote

Hi Christy,

Below DFSORT JCL will give you desire output. Assumed RECFM=FB & LRECL=80. Attributes can be change accordingly.
Code:
//STEP10   EXEC PGM=ICEMAN                                         
//*                                                                 
//SYSOUT   DD  SYSOUT=*                                             
//SYMNAMES DD *                                                     
PAD,'","'                                                           
QUT,'"'                                                             
/*                                                                 
//*                                                                 
//SORTIN   DD *                                                     
----+----1----+----2----+----3----+----4----+----5----+----6----+---
0001000120100010000400000000000000000000000000                     
0001000220100010000400000000000000000000000000                     
0001000320100010000400000000000140000001905215                     
0001000420100010000400000000000700000000000898                     
0001000520100010000400000000000430000000000792                     
0001000620100010000400000000000000000000000000                     
0001000720100010000400000000000000000000000000                     
/*                                                                 
//*                                                                 
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  OPTION COPY                                                       
 INREC IFTHEN=(WHEN=INIT,                                         
      BUILD=(1:C'"PURCHASES',PAD,14:1,4,PAD,21:5,4,PAD,28:9,4,PAD,
             35:13,4,PAD,42:17,4,PAD,                             
             49:21,13,UFF,EDIT=(IIIIIIIIIIT.TT),PAD,             
             66:34,13,UFF,EDIT=(IIIIIIIIIIT.TT),QUT)),           
      IFTHEN=(WHEN=(60,3,CH,EQ,C'.00'),                           
      OVERLAY=(60:3X),HIT=NEXT),                                 
      IFTHEN=(WHEN=(77,3,CH,EQ,C'.00'),                           
      OVERLAY=(77:3X))                                           
  OUTREC BUILD=(1,80,SQZ=(SHIFT=LEFT,PREBLANK=C' '))               
/*

OUTPUT:
Code:
"PURCHASES","0001","0001","2010","0010","0004","0","0"         
"PURCHASES","0001","0002","2010","0010","0004","0","0"         
"PURCHASES","0001","0003","2010","0010","0004","0.14","19052.15"
"PURCHASES","0001","0004","2010","0010","0004","0.70","8.98"   
"PURCHASES","0001","0005","2010","0010","0004","0.43","7.92"   
"PURCHASES","0001","0006","2010","0010","0004","0","0"         
"PURCHASES","0001","0007","2010","0010","0004","0","0"         
Back to top
View user's profile Send private message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Wed Dec 08, 2010 5:22 pm    Post subject: Reply to: Squeeze parameter with edit mask in dfsort
Reply with quote

Hi,

Thank you very much.

But i would like to know what PAD,QUT and UFF stands for and please could you explain those.


Thanks,
Christy.
Back to top
View user's profile Send private message
sriram.mukundan

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Thu Dec 09, 2010 10:10 am    Post subject:
Reply with quote

Thanks for the information nelson.

PAD and QUT are assigned with the value '","' and '"' respectively in the SYMNAMES DD statement.
It is symbolic representation.
Instead of Hardcoding in the INREC field, he used symbolic representation.

UFF- Free Form (Unsigned Numeric)

-Regards
Sriram Mukundan
Back to top
View user's profile Send private message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Thu Dec 09, 2010 11:16 am    Post subject: Reply to: Squeeze parameter with edit mask in dfsort
Reply with quote

Hi,

Thank you very much.


It helped me alot to understand more.


Thanks nad Regards,

Christy
Back to top
View user's profile Send private message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Thu Dec 09, 2010 11:19 am    Post subject:
Reply with quote

Hi,

One of the members send me this code too.


It worked as well.

Code:

//SYSIN DD *                                                       
 OPTION COPY                                                       
 INREC IFTHEN=(WHEN=INIT,                                           
       OVERLAY=(81:21,13,ZD,EDIT=(IIIIIIIIIIT.TT),C'","',           
                   34,13,ZD,EDIT=(IIIIIIIIIIT.TT),C'"')),           
       IFTHEN=(WHEN=(21,13,ZD,EQ,0),OVERLAY=(91:C'   0'),HIT=NEXT),
       IFTHEN=(WHEN=(34,13,ZD,EQ,0),OVERLAY=(108:C'   0'))         
 OUTREC BUILD=(C'"PURCHASE","',01,4,C'","',05,4,C'","',             
                   09,4,C'","',13,4,C'","',17,4,C'","',             
                   81,32,SQZ=(SHIFT=LEFT))     
/*


Thanks to all.

Regards,

Christy
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Thu Dec 09, 2010 12:52 pm    Post subject:
Reply with quote

Christy,

Thanks for posting icon_smile.gif
Learn to use "Code" tags while posting run JCL/sort card/sample data to make it rather readable.
Back to top
View user's profile Send private message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Thu Dec 09, 2010 1:01 pm    Post subject:
Reply with quote

Sure,

The above code reformatted below.

Code:
//SYSIN DD *                                                       
 OPTION COPY                                                       
 INREC IFTHEN=(WHEN=INIT,                                           
       OVERLAY=(81:21,13,ZD,EDIT=(IIIIIIIIIIT.TT),C'","',           
                   34,13,ZD,EDIT=(IIIIIIIIIIT.TT),C'"')),           
       IFTHEN=(WHEN=(21,13,ZD,EQ,0),OVERLAY=(91:C'   0'),HIT=NEXT),
       IFTHEN=(WHEN=(34,13,ZD,EQ,0),OVERLAY=(108:C'   0'))         
 OUTREC BUILD=(C'"PURCHASE","',01,4,C'","',05,4,C'","',             
                   09,4,C'","',13,4,C'","',17,4,C'","',             
                   81,32,SQZ=(SHIFT=LEFT))
/*




Thanks for that too.


Regards,

Christy
Back to top
View user's profile Send private message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Thu Dec 09, 2010 1:07 pm    Post subject:
Reply with quote

Thanks for everyones help.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts JTS parameter Shashank Chaubey JCL & VSAM 2 Thu Jul 13, 2017 4:15 pm

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