Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Reformatting record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Wed Apr 07, 2010 7:03 pm    Post subject: Reformatting record
Reply with quote

Hi ,
I have a couple of record lines as follows:

Code:
123 123 9.802600 8.953100 0.000000 0.195000 0.133000 0.152000
234 234 11.23710 5.745100 0.000000 0.121000 0.149000 0.259000


I need to format the above record as:

Code:
123 123 0980260 0895310 0000000 0019500 0013300 0015200
234 234 1123710 0574510 0000000 0012100 0014900 0025900


The problem lies into two accounts:
1. The no of digits before Decimal varies
2. Due to the decimal we can't use ZD format.

Kindly let us know if this can be done in easier way in Sort.

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

Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Wed Apr 07, 2010 7:18 pm    Post subject: Reply to: Reformatting record
Reply with quote

Hi,

I solved it using the following card:

Code:
PARSE=(%12=(ENDBEFR=C' ',FIXLEN=(3)),                   
       %13=(ENDBEFR=C' ',FIXLEN=(3)),                   
       %14=(ABSPOS=9,ENDBEFR=C'.',FIXLEN=(2)),         
       %15=(ENDBEFR=C' ',FIXLEN=(5)),                   
       %16=(ABSPOS=18,ENDBEFR=C'.',FIXLEN=(2)),         
       %17=(ENDBEFR=C' ',FIXLEN=(5)),                   
       %18=(ABSPOS=27,ENDBEFR=C'.',FIXLEN=(2)),         
       %19=(ENDBEFR=C' ',FIXLEN=(5)),                   
       %20=(ABSPOS=36,ENDBEFR=C'.',FIXLEN=(2)),         
       %21=(ENDBEFR=C' ',FIXLEN=(5)),                   
       %22=(ABSPOS=45,ENDBEFR=C'.',FIXLEN=(2)),         
       %23=(ENDBEFR=C' ',FIXLEN=(5)),                   
       %24=(ABSPOS=54,ENDBEFR=C'.',FIXLEN=(2)),         
       %25=(ENDBEFR=C' ',FIXLEN=(5))),                 
BUILD=(%12,5:%13,9:%14,SFF,EDIT=(TT),%15,17:%16,SFF,   
      EDIT=(TT),%17,25:%18,SFF,EDIT=(TT),%19,33:%20,SFF,
      EDIT=(TT),%21,41:%22,SFF,EDIT=(TT),%23,49:%24,SFF,
      EDIT=(TT),%25,80:X)     


Please let me know if this can be achieved by any shorter/easier means.

Thanks
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 07, 2010 7:23 pm    Post subject:
Reply with quote

I assume you are using SyncSort (JCL part of the forum) - what release of it you are using? You might try this:
Code:
//SYSIN    DD    *                 
  OPTION COPY                       
  INREC FINDREP=(IN=C'.',OUT=C'')   
/*                                 
Support for FINDREP was included in SyncSort for z/OS 1.3.2.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 07, 2010 7:25 pm    Post subject:
Reply with quote

You could also use ALTSEQ.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 07, 2010 7:26 pm    Post subject:
Reply with quote

Ya beat me to it.....


SyncSort for z/OS 1.3 Programmer’s Guide wrote:
SFF Signed free format. Decimal digits (0-9) are extracted from right to left to form a number value. A character of – or ) found within the field will cause the value to be treated as a negative number. All other nondecimal digit values in the field are ignored. A maximum of 31 digits can be provided. When more than 31 digits are found in the field, the leftmost digits will be ignored.


z/OS V1R11.0 DFSORT Application Programming Guide wrote:
SFF (signed free form numeric). This format extracts decimal digits (0-9) from right to left anywhere in the field to form a positive or negative number. If - or ) is found anywhere in the field, the number is treated as negative, otherwise it is treated as positive. Any combination of characters is valid, but characters other than 0-9, - and ) are ignored.
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Wed Apr 07, 2010 7:36 pm    Post subject: Reply to: Reformatting record
Reply with quote

Hi Anuj,

I am using SYNCSORT Z/OS 1.3.2.1.

I am quite not sure if
Code:
INREC FINDREP=(IN=C'.',OUT=C'')
can be used as the field lenghts vary betewwn input & output.

Also I have never used ALTSEQ. Can you kindly provide me an example.

Thanks
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 07, 2010 7:41 pm    Post subject:
Reply with quote

Be aware that both ALTSEQ and FINDREP affect the entire record, a period appearing anywhere else will also be converted.... icon_eek.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 07, 2010 8:12 pm    Post subject: Re: Reply to: Reformatting record
Reply with quote

Learncoholic wrote:
I am quite not sure if
Code:
INREC FINDREP=(IN=C'.',OUT=C'')
can be used as the field lenghts vary betewwn input & output.
Suggest you run a test on some sample input and verify the output to check if that satisfies your requirement.

Quote:
Also I have never used ALTSEQ. Can you kindly provide me an example.
Please search the Forum on "ALTSEQ" either JCL or DFSORT part of the Forum - if you want to narrow down your search, you might give author-name as "Frank Yaeger" or "skolusu" or "Alissa Margulies" or "Arun Raj" or...

And yes, keep in mind what William has suggested, however, for the shown sample input, you can use the FINDREP sort-card I provided.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Apr 07, 2010 9:31 pm    Post subject:
Reply with quote

Hi Anuj,

Quote:
you can use the FINDREP sort-card
Not if i understand the requirement. . .

9.802600 is supposed to become 09802600 - unless i missed something (which is quite possible icon_smile.gif ). . .
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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us