Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

bit to 8 different char
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
Vikas.betu
Member


Joined: 18 Feb 2014
Posts: 29

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Feb 18, 2014 9:19 pm    Post subject: bit to 8 different char Reply with quote

I have with flag information embeeded in a charactor. Each bit of a charactor indicates a statos of a specific flag. Means a byte has information about 8 different flags. I wanted to expand this bit information to a seperate charactor, as each character indicates a status of a flag (1/0) in a JCL. Can someone suggest me the solution?

I found 1 jcl for my requirment, but I am not getting what exactly going on in this
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/10)
//SORTOUT DD DSN=... output file (FB/10)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=10,
IFTHEN=(WHEN=INIT,BUILD=(8C'0',9:9,2,11:1,1)),
IFTHEN=(WHEN=(11,1,BI,BO,X'80'),OVERLAY=(1:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'40'),OVERLAY=(2:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'20'),OVERLAY=(3:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'10'),OVERLAY=(4:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'08'),OVERLAY=(5:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'04'),OVERLAY=(6:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'02'),OVERLAY=(7:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'01'),OVERLAY=(8:C'1'))

Can someone explain this ?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 12:48 am    Post subject: Reply with quote

What this does is turns on all of the bits for that byte where each bit is "on".

Pick a 1-byte value - say the letter A.

Which 1s and 0s make up the letter A?
Well, first what is the hex representation for the letter A? x'C1'.

How is x'C1" shown in binary? b'1100 0001'.Which is what that code shuld produce - creating 8 bytes for the one.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Vikas.betu
Member


Joined: 18 Feb 2014
Posts: 29

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 1:48 am    Post subject: Reply with quote

Thanks for response. But I am new for DFSORT, I got this sort card from mainframe forum itselt. But not able to understand this
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 1:54 am    Post subject: Reply with quote

If you use the code you have and the explanation from the manual (and my brief explanation), you will be able to get the understanding.

It wiould be better to become comfortable with the sort before just copying things from the internet that you do not understand.

fwiw.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
NicC
Active Member


Joined: 24 Jul 2011
Posts: 650
Location: Down on the pig farm

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 1:59 am    Post subject: Reply with quote

He he! Maybe you cn move this one? And delete the spurious posts afterwards?
_________________
Regards
Nic
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 2:08 am    Post subject: Reply with quote

Yup, 'tis moved and pruned Cool

dd
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Vikas.betu
Member


Joined: 18 Feb 2014
Posts: 29

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 3:07 am    Post subject: Reply with quote

I got this sort partial, however the main problem I m facing below line
IFTHEN=(WHEN=INIT,BUILD=(8C'0',9:9,2,11:1,1)),

I don't want to waste your time, but I am trying to learn. If possbile then revert
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 3:38 am    Post subject: Reply with quote

You're not wasting my time - i just don't have as much as i'd prefer Smile

The doc has a rather clear description of WHEN=INIT (first time). The BUILD generates 8 character zeros to be replaced with ones dependking on the character value (refer to the example i posted earlier).
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 4:17 am    Post subject: Re: bit to 8 different char Reply with quote

Vikas.betu wrote:
I have with flag information embeeded in a charactor. Each bit of a charactor indicates a statos of a specific flag. Means a byte has information about 8 different flags. I wanted to expand this bit information to a seperate charactor, as each character indicates a status of a flag (1/0) in a JCL. Can someone suggest me the solution?

I found 1 jcl for my requirment, but I am not getting what exactly going on in this
Code:
//S1    EXEC  PGM=SORT                                             
//SYSOUT    DD  SYSOUT=*                                           
//SORTIN DD DSN=...  input file (FB/10)
//SORTOUT DD DSN=...  output file (FB/10)                           
//SYSIN    DD    *                                                 
  OPTION COPY                                                       
  INREC IFOUTLEN=10,                                               
    IFTHEN=(WHEN=INIT,BUILD=(8C'0',9:9,2,11:1,1)),                 
    IFTHEN=(WHEN=(11,1,BI,BO,X'80'),OVERLAY=(1:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'40'),OVERLAY=(2:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'20'),OVERLAY=(3:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'10'),OVERLAY=(4:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'08'),OVERLAY=(5:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'04'),OVERLAY=(6:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'02'),OVERLAY=(7:C'1'),HIT=NEXT),     
    IFTHEN=(WHEN=(11,1,BI,BO,X'01'),OVERLAY=(8:C'1')) 


Can someone explain this ?


Where did you find that code?

If your DFSORT is fairly up-to-date:

Code:
  OPTION COPY
  INREC BUILD=(1,1,TRAN=BIT,9,2)
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Vikas.betu
Member


Joined: 18 Feb 2014
Posts: 29

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 8:28 pm    Post subject: Reply with quote

I got this code from this forum only, I have tried your code but it is giving me syntax error Sad
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Vikas.betu
Member


Joined: 18 Feb 2014
Posts: 29

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 19, 2014 10:08 pm    Post subject: Reply with quote

I have a single char field, having values '.' or blanks(its a coded value through assembler prog). Now I need to decode these values to 8 bit field whose outputs looks like '1100 0001'(it's just a example). Can you guys provide me any jcl sort to resolve this. I am asking this directly as I am not able to make any change in above mentioned jcl coz it's bit different jcl what I understand from this.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Feb 20, 2014 1:57 am    Post subject: Reply with quote

Copy the above and make the changes . . .

Why have you not posted the error(s)?

Keep in mind that most of the work getting help is yours. We can only help with what you show us.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Feb 20, 2014 12:34 pm    Post subject: Reply with quote

Did you note the "if your DFSORT is fairly up-to-date"?

Paste the full sysout from your step. We will need another way to do it, probably, as it sounds like your system does not support TRAN=
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Vikas.betu
Member


Joined: 18 Feb 2014
Posts: 29

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Feb 20, 2014 7:54 pm    Post subject: Reply with quote

Please find the sysout msg when I ran below job
----------------------------------------------------------------
//EMPACT1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=INPUT,DISP=SHR
//SORTOUT DD DSN=OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=(RECFM=FB,LRECL=0,BLKSIZE=0)
//SYSUDUMP DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
-------------------------------------------------------------------
********SYSOUT*********
609 LICEN
SYSIN :
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************* Bottom of Data ********************************
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Feb 20, 2014 10:21 pm    Post subject: Reply with quote

Hopefully, you have noticed that your system is using Syncsort rather than DFSORT.

The tran=bit is not yet available in Syncsort as far as i know.

You need to determine how to make the IFTHEN / OVERLAY work.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7451.html